-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.sql
More file actions
21 lines (17 loc) · 722 Bytes
/
sample.sql
File metadata and controls
21 lines (17 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.load libsimple
CREATE TABLE IF NOT EXISTS docs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
pid INTEGER NOT NULL DEFAULT 0,
gid TEXT NOT NULL,
tag INTEGER NOT NULL, -- [1,7]
locale VARCHAR(32) NOT NULL,
version VARCHAR(32) NOT NULL,
content TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS docs_idx_gid ON docs(gid);
CREATE INDEX IF NOT EXISTS docs_idx_pid ON docs(pid);
CREATE INDEX IF NOT EXISTS docs_idx_tag ON docs(tag);
CREATE INDEX IF NOT EXISTS docs_idx_locale ON docs(locale);
CREATE INDEX IF NOT EXISTS docs_idx_version ON docs(version);
CREATE VIRTUAL TABLE IF NOT EXISTS d USING fts5(id, pid, gid, tag, locale, version, content, tokenize = 'simple');
-- INSERT INTO d SELECT * FROM docs;