sql formatting

This commit is contained in:
abdo 2021-01-09 17:38:16 +03:00
parent f7f509c70d
commit 97b4c2124c
3 changed files with 19 additions and 23 deletions

View file

@ -1,4 +1,3 @@
insert INSERT
or replace into tags (id, name, usn, config) OR REPLACE INTO tags (id, name, usn, config)
values VALUES (?, ?, ?, ?)
(?, ?, ?, ?)

View file

@ -1,13 +1,10 @@
select SELECT CASE
case WHEN ?1 IN (
when ?1 in ( SELECT id
select FROM tags
id ) THEN (
from tags SELECT max(id) + 1
) then ( FROM tags
select
max(id) + 1
from tags
) )
else ?1 ELSE ?1
end; END;

View file

@ -1,7 +1,7 @@
drop table tags; DROP TABLE tags;
create table tags ( CREATE TABLE tags (
id integer primary key not null, id integer PRIMARY KEY NOT NULL,
name text not null collate unicase, name text NOT NULL COLLATE unicase,
usn integer not null, usn integer NOT NULL,
config blob not null config blob NOT NULL
); );