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
or replace into tags (id, name, usn, config)
values
(?, ?, ?, ?)
INSERT
OR REPLACE INTO tags (id, name, usn, config)
VALUES (?, ?, ?, ?)

View File

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

View File

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