Oleg

I see your point - I am using MySQL and didn't think about the other DB's.

Looking more closely at the postgresql and sqlite docs, plus the fact that REPLACE is not standard SQL at all, I see that it will be quite a job to implement a more flexible Replace expression that supports all the different DB's in their own peculiar ways:

* postgresql: does not even have any sort of REPLACE at all (AFAICT)
* sqlite: REPLACE works like its INSERT: /"The REPLACE command is an alias for the "INSERT OR REPLACE" variant of the INSERT command. This alias is provided for compatibility with MySQL.". /

So if I wanted to improve the sqlbuilder Replace, I guess it would be best to have a totally new Replace expression (not inheriting from Insert or Update), and then have lots of these:
   if db == "..."

Would this be the way to go?

- Frank

Oleg Broytmann wrote:
On Tue, Dec 04, 2007 at 02:29:10PM -0800, Frank Conradie wrote:
I don't want to fight with you, but INSERT also supports SET:

   No, it doesn't (meaning "standard" SQL).

http://www.postgresql.org/docs/7.3/static/sql-insert.html :

INSERT INTO table [ ( column [, ...] ) ]
     { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...]) | SELECT 
query }

http://sqlite.org/lang_insert.html :

INSERT [OR conflict-algorithm] INTO [database-name .]  table-name
     [(column-list)] VALUES (value-list)

   SQLObject produces that (more or less) standard INSERT, not MySQL
variant.

PS. But if you want to teach SQLObject to generate MySQLish INSERT - you
know where to send patches.

Oleg.
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to