Created
May 26, 2023 19:49
-
-
Save denisdemaisbr/480603d57f50b572b3846939f0e450ed to your computer and use it in GitHub Desktop.
sqlite3 insert or replace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- insert or replace sqlite 3.x | |
create table config( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, key text, value text ); | |
insert into config values (1, "fg", "#ff00ff" ); | |
insert or replace into config(id, key, value) values ((select id from config where key = "bg"), "bg", "0x00ff00"); | |
SELECT * FROM config; | |
$ sqlite3 < test.sql | |
SQLite version 3.34.0 2020-12-01 16:14:00 | |
1|fg|#ff00ff | |
2|bg|0x00ff00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment