[geeklog-devel] Fwd: MSSQL Class - SQL Coding

Joe Mucchiello joe at ThrowingDice.com
Fri May 29 20:51:43 EDT 2009


If I may make a suggestion, lib-database (and the database classes 
obviously) should help support SQL construction. Currently, for 
example, if you want to include mySQL's NOW() function in a query, 
you need to code the query for mssql with GETDATE() instead. It would 
be nice if lib-database provided some helper functions to remove the 
need to do the $sql['mysql'] thing at all. Instead you would say:

$sql = ..... DB_function('now') .....

or something to format dates correctly:

$sql = ...... DB_date($timestamp) ....

Obviously this is something that would need to planned for 1.7 I 
guess. But this would be make database agnostic coding much easier in 
the future. The trick is identifying what parts are different across 
various versions of SQL and making functions for them without knowing 
what future dialects will exist.

Also, I don't recommend this for the DDL. Every RDBMS has its own 
nearly unique DDL that it just isn't worth it. That's why plugins 
have different files for each database.

I still want to know how the pgsql layer is going to handle big text fields....

----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 



No virus found in this outgoing message
Checked by PC Tools AntiVirus (6.0.0.19 - 10.004.038).
http://www.pctools.com/free-antivirus/



More information about the geeklog-devel mailing list