sindicate / solidbase

SolidBase is a database change management and version control tool that uses annotated SQL
https://code.google.com/p/solidbase/
Apache License 2.0
2 stars 0 forks source link

IMPORT into UPDATE or MERGE statements instead of INSERT? #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
IMPORT CSV
UPDATE ATABLE
SET ACOL = :2
WHERE ID = :1;
1,2
3,4

Maybe we should discard the old INSERT syntax completely and make it:

IMPORT CSV
INSERT INTO TEMP3 ( TEMP1, TEMP2, TEMP3, TEMP4 )
VALUES ( :2, CONVERT( :1, INTEGER ) + :2, 'Y', '-)-", TEST ''X' );
1,2
3,4

and for an external file:

IMPORT CSV
FILE "file" ENCODING "UTF-8"
INSERT INTO TEMP3 ( TEMP1, TEMP2, TEMP3, TEMP4 )
VALUES ( :2, CONVERT( :1, INTEGER ) + :2, 'Y', '-)-", TEST ''X' );

I think it is possible to detect the old syntax by detecting the INTO.

Critical because breaking changes must be implemented before 2.0.0 is released.

Original issue reported on code.google.com by rene.de....@gmail.com on 5 Apr 2012 at 6:23

GoogleCodeExporter commented 9 years ago

Original comment by rene.de....@gmail.com on 6 Apr 2012 at 5:59