Ticket #799 (new Patch)

Opened 3 months ago

Last modified 8 weeks ago

Allow custom queries to easily use table prefix

Reported by: Nodren Owned by: zombor
Priority: minor Milestone: 2.3
Component: Libraries:Database Version: SVN HEAD
Keywords: Cc:

Description

similar to how if we write a custom query, we can use ? to represent an argument, could we add something similar to represent a table prefix?

just as a suggestion, i've seen other apps accomplish this by enclosing the table in {} brackets. so if the prefix was kohana_ then the query would be written like:

select * from {table} where field = ?

and would show up like:

select * from kohana_table where field = 1

Attachments

MY_Database.2.php (464 bytes) - added by Nodren 8 weeks ago.
Database.php patch
MY_Database.php (509 bytes) - added by Nodren 8 weeks ago.
Database.php patch

Change History

Changed 8 weeks ago by Nodren

Database.php patch

Changed 8 weeks ago by Nodren

  • type changed from Feature Request to Patch

added a patch for accomplishing this...its in the form of a class extension, but should be self explanitory to impliment into the actual database class

Changed 8 weeks ago by Nodren

Database.php patch

Note: See TracTickets for help on using tickets.