Open isso-719 opened 2 weeks ago
Google standard SQL has INSERT OR IGNORE and INSERT OR UPDATE but wrench is not supported. https://cloud.google.com/spanner/docs/reference/standard-sql/dml-syntax#insert-ignore
INSERT OR IGNORE
INSERT OR UPDATE
INSERT OR IGNORE INTO Singers (SingerId, FirstName, LastName, Birthdate, Status, SingerInfo) VALUES (5, "Zak", "Sterling", "1996-03-12", "active", "nationality:'USA'"), (7, "Edie", "Silver", "1998-01-23", "active", "nationality:'USA'");
go run github.com/cloudspannerecosystem/wrench apply --dml "./db/testdata/000001.sql" --project local --instance emulator --database singers Error command: apply, version: v1.10.1 ./db/testdata/000001.sql:1.10: got "IGNORE" while expecting "(" exit status 1
We used to delete all data and then insert. This can be simplified with INSERT OR IGNORE.
WHAT
Google standard SQL has
INSERT OR IGNORE
andINSERT OR UPDATE
but wrench is not supported. https://cloud.google.com/spanner/docs/reference/standard-sql/dml-syntax#insert-ignoreWHY
We used to delete all data and then insert. This can be simplified with
INSERT OR IGNORE
.