Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please support INSERT OR IGNORE and INSERT OR UPDATE syntax #120

Open
isso-719 opened this issue Nov 5, 2024 · 1 comment
Open

please support INSERT OR IGNORE and INSERT OR UPDATE syntax #120

isso-719 opened this issue Nov 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@isso-719
Copy link

isso-719 commented Nov 5, 2024

WHAT

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 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

WHY

We used to delete all data and then insert.
This can be simplified with INSERT OR IGNORE.

@isso-719 isso-719 added the enhancement New feature or request label Nov 5, 2024
@isso-719 isso-719 changed the title Please the INSERT OR IGNORE and INSERT OR UPDATE syntax. please support INSERT OR IGNORE and INSERT OR UPDATE syntax Nov 5, 2024
@apstndb
Copy link
Contributor

apstndb commented Dec 12, 2024

I believe this issue is already resolved by #121.
Owners need to release new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants