Difference between revisions of "Gallery3:Developer Handbook:Database Abstraction Layer" - Gallery Codex
Personal tools

Difference between revisions of "Gallery3:Developer Handbook:Database Abstraction Layer"

From Gallery Codex

(Created page with "=Database Abstraction Layer= Gallery 3 uses the Kohana Database Abstraction Layer. This is well documented on the Kohana website: * [http://docs.kohanaphp.com/libraries/databas...")
 
Line 8: Line 8:
 
* You don’t have to worry about creating connections to the database, this is handled for you by the Gallery 3 framework
 
* You don’t have to worry about creating connections to the database, this is handled for you by the Gallery 3 framework
 
* Gallery 3 only supports MySQL 5.x so it’s perfectly legal to use SQL statements that are only supported by MySQL 5.x.
 
* Gallery 3 only supports MySQL 5.x so it’s perfectly legal to use SQL statements that are only supported by MySQL 5.x.
* The Kohana docs are slightly out of date.  To build a query, the new syntax is:
+
* The Kohana docs are slightly out of date.  To build a query, the new syntax is: ''db::build()''
''db::build()''
+
 
* Gallery 3 database tables can have a prefix to distinguish them from other tables in the same database.  To support prefixes properly, all table names must be wrapped in curly braces whenever used in a database query.  For example:  ''$db->query(“SELECT * FROM {tags}”)''
 
* Gallery 3 database tables can have a prefix to distinguish them from other tables in the same database.  To support prefixes properly, all table names must be wrapped in curly braces whenever used in a database query.  For example:  ''$db->query(“SELECT * FROM {tags}”)''
  
 
[[Category:Gallery 3:Developer Handbook]]
 
[[Category:Gallery 3:Developer Handbook]]

Revision as of 14:16, 13 June 2011

Database Abstraction Layer

Gallery 3 uses the Kohana Database Abstraction Layer. This is well documented on the Kohana website:

Notes about the Gallery 3 database abstraction layer:

  • You don’t have to worry about creating connections to the database, this is handled for you by the Gallery 3 framework
  • Gallery 3 only supports MySQL 5.x so it’s perfectly legal to use SQL statements that are only supported by MySQL 5.x.
  • The Kohana docs are slightly out of date. To build a query, the new syntax is: db::build()
  • Gallery 3 database tables can have a prefix to distinguish them from other tables in the same database. To support prefixes properly, all table names must be wrapped in curly braces whenever used in a database query. For example: $db->query(“SELECT * FROM {tags}”)
advertisements