Query builder that works with all major databases?

kool

New Member
I need to use a query builder that generates SQL statements containing placeholders.It should:
  • Generate SQL statements containing placeholders(:placeHolder and ?)
  • Have no object mapping
  • Return the query as a string + array of placeholders names or similar
  • Work with all major databases(e.g. Oracle, MySQL)
  • Generating queries without connecting to database
I am thinking about something like this:\[code\]QueryBuilder::select( 'db' => 'MySQL' 'from' => 'users', 'fields' => array( 'user_id' => 'id' ), 'where' => array( 'AND' => array( /** * ...conditions... */ ) ), 'ljoin' => array( 'Group' => array( 'from' => 'groups' /** * ...stuff... */ ) ));\[/code\]I looked into Doctrine2 but it needs object mapping. And a lot of initial configuration.Note: Queries are generated in development stage and saved as plain text for each supported database engine.Thank you in advance.
 
Back
Top