Ticket #307 (fixed enhancement)
Create a new database layer and query builder
- Created: 2011-02-22 12:48:29
- Reported by: Reines
- Assigned to: Reines
- Milestone: 2.0-alpha1
- Component: database
- Priority: high
FluxBB 2.0 should use PDO for database driver abstraction, and have a query builder in a similar style to 1.3 - allowing for easy query modification by extensions.
Requirements: Query builder (extensible), SQL abstraction, parameter sanitizing, driver abstraction.
Support: MySQLi (MySQL is for PHP < 5 and MySQL < 4.1.3, no need), SQLite3 (what about SQLite2? - nuke it from orbit), PgSQL. Leave others (OCI8, MSSQL, Firebird) to community?
I made a start on this with php-db, but the query builder isn't complete.
This has quite a few advantages, including proper support for prepared statements.
We should do benchmarks to see if caching of SQL is actually worth it - where is the performance hit.
Franz 2011-02-22 22:58:44
- Type changed from enhancement to task.
Reines 2011-02-22 23:54:32
- Type changed from task to enhancement.
Reines 2011-02-25 00:44:48
- Milestone changed from 2.0-beta1 to 2.0-alpha1.
Reines 2011-03-01 09:47:12
- Owner set to Reines.
Reines 2011-03-21 10:41:38
I've made a start on this in a new branch.
One important point to note is we now use prepared statements, so if a query is to be used within a loop we can construct it above the loop, then use then simply pass a new $params array each time.
Franz 2011-04-20 07:32:46
This is now done except for some more difficult queries (INSERT...SELECT, JOIN SELECT...) and some database-dependent code.
Reines 2011-04-20 07:36:16
Cheers, I'll try sort out support for the more difficult queries soon.
Franz 2011-10-26 21:49:45
- Status changed from open to fixed.
I'll mark this as closed, as we now have a fully working solution.
I still need to do some cleanup and adapt the FluxBB core to use the new system, but as far as creating the system, we're done.