-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprojects
More file actions
75 lines (75 loc) · 5.69 KB
/
Copy pathprojects
File metadata and controls
75 lines (75 loc) · 5.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SELECT 1 FROM sqlite_schema o WHERE sql LIKE 'CREATE VIRTUAL TABLE%' AND name LIKE 'projects' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'projects' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'));
SAVEPOINT dump;
PRAGMA writable_schema=ON;
SELECT name, type, sql FROM sqlite_schema AS o WHERE (name LIKE 'projects' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'projects' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'))) AND type=='table' AND sql NOT NULL ORDER BY tbl_name='sqlite_sequence', rowid;
PRAGMA table_info='projects';
SELECT name,description,created_at,updated_at FROM projects;
SELECT sql FROM sqlite_schema AS o WHERE (name LIKE 'projects' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'projects' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'))) AND sql NOT NULL AND type IN ('index','trigger','view') ORDER BY type COLLATE NOCASE DESC;
PRAGMA writable_schema=OFF;
RELEASE dump;
SELECT 1 FROM sqlite_schema o WHERE sql LIKE 'CREATE VIRTUAL TABLE%' AND name LIKE 'logs' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'logs' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'));
SAVEPOINT dump;
PRAGMA writable_schema=ON;
SELECT name, type, sql FROM sqlite_schema AS o WHERE (name LIKE 'logs' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'logs' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'))) AND type=='table' AND sql NOT NULL ORDER BY tbl_name='sqlite_sequence', rowid;
PRAGMA table_info='logs';
SELECT id,item_id,message,created_at FROM logs;
SELECT sql FROM sqlite_schema AS o WHERE (name LIKE 'logs' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'logs' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'))) AND sql NOT NULL AND type IN ('index','trigger','view') ORDER BY type COLLATE NOCASE DESC;
PRAGMA writable_schema=OFF;
RELEASE dump;
PRAGMA database_list;
SELECT name FROM "main".sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite__%' ESCAPE '_' AND name LIKE ?1 ORDER BY 1;
SELECT 1 FROM sqlite_schema o WHERE sql LIKE 'CREATE VIRTUAL TABLE%' AND name LIKE 'logs' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'logs' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'));
SAVEPOINT dump;
PRAGMA writable_schema=ON;
SELECT name, type, sql FROM sqlite_schema AS o WHERE (name LIKE 'logs' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'logs' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'))) AND type=='table' AND sql NOT NULL ORDER BY tbl_name='sqlite_sequence', rowid;
PRAGMA table_info='logs';
SELECT id,item_id,message,created_at FROM logs;
SELECT sql FROM sqlite_schema AS o WHERE (name LIKE 'logs' ESCAPE '\' OR EXISTS ( SELECT 1 FROM sqlite_schema WHERE name LIKE 'logs' ESCAPE '\' AND sql LIKE 'CREATE VIRTUAL TABLE%' AND substr(o.name, 1, length(name)+1) == (name||'_'))) AND sql NOT NULL AND type IN ('index','trigger','view') ORDER BY type COLLATE NOCASE DESC;
PRAGMA writable_schema=OFF;
RELEASE dump;
SELECT DISTINCT candidate COLLATE nocase FROM completion('.sch') ORDER BY 1;
-- PRAGMA database_list;
-- PRAGMA database_list;
-- SELECT name FROM "main".sqlite_schema;
-- PRAGMA database_list;
-- SELECT pti.name FROM "main".sqlite_schema AS sm JOIN pragma_table_xinfo(sm.name,'main') AS pti WHERE sm.type='table';
-- PRAGMA 'main'.table_xinfo='labels';
-- PRAGMA 'main'.table_xinfo='item_labels';
-- PRAGMA 'main'.table_xinfo='items';
-- PRAGMA 'main'.table_xinfo='deps';
-- PRAGMA 'main'.table_xinfo='logs';
-- PRAGMA 'main'.table_xinfo='projects';
-- PRAGMA 'main'.table_xinfo='concepts';
-- PRAGMA 'main'.table_xinfo='learnings';
-- PRAGMA 'main'.table_xinfo='learning_concepts';
-- SELECT k, v FROM 'main'.'learnings_fts_config';
-- PRAGMA 'main'.table_xinfo='learnings_fts';
-- PRAGMA 'main'.table_xinfo='learnings_fts_data';
-- PRAGMA 'main'.table_xinfo='learnings_fts_idx';
-- PRAGMA 'main'.table_xinfo='learnings_fts_docsize';
-- PRAGMA 'main'.table_xinfo='learnings_fts_config';
SELECT DISTINCT candidate COLLATE nocase FROM completion('.sch') ORDER BY 1;
-- PRAGMA database_list;
-- PRAGMA database_list;
-- SELECT name FROM "main".sqlite_schema;
-- PRAGMA database_list;
-- SELECT pti.name FROM "main".sqlite_schema AS sm JOIN pragma_table_xinfo(sm.name,'main') AS pti WHERE sm.type='table';
-- PRAGMA 'main'.table_xinfo='labels';
-- PRAGMA 'main'.table_xinfo='item_labels';
-- PRAGMA 'main'.table_xinfo='items';
-- PRAGMA 'main'.table_xinfo='deps';
-- PRAGMA 'main'.table_xinfo='logs';
-- PRAGMA 'main'.table_xinfo='projects';
-- PRAGMA 'main'.table_xinfo='concepts';
-- PRAGMA 'main'.table_xinfo='learnings';
-- PRAGMA 'main'.table_xinfo='learning_concepts';
-- PRAGMA 'main'.table_xinfo='learnings_fts';
-- PRAGMA 'main'.table_xinfo='learnings_fts_data';
-- PRAGMA 'main'.table_xinfo='learnings_fts_idx';
-- PRAGMA 'main'.table_xinfo='learnings_fts_docsize';
-- PRAGMA 'main'.table_xinfo='learnings_fts_config';
SELECT name FROM pragma_database_list;
-- PRAGMA database_list;
SELECT sql FROM(SELECT shell_add_schema(sql,NULL,name) AS sql, type, tbl_name, name, rowid,1 AS snum, 'main' AS sname FROM main.sqlite_schema) WHERE sql IS NOT NULL ORDER BY snum, rowid;
-- PRAGMA "main".table_info='learnings_fts';
-- PRAGMA "main".table_info='learnings_fts';