@nymbalhq/platform 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,6 +50,13 @@
50
50
  "when": 1792397472998,
51
51
  "tag": "0006_minor_dragon_man",
52
52
  "breakpoints": true
53
+ },
54
+ {
55
+ "idx": 7,
56
+ "version": "7",
57
+ "when": 1792550523604,
58
+ "tag": "0007_native_search",
59
+ "breakpoints": true
53
60
  }
54
61
  ]
55
62
  }
@@ -0,0 +1,39 @@
1
+ -- The native search index. Rows are keyed by `id` (an upsert is a point write); `rid` is an INTEGER PRIMARY KEY so
2
+ -- the external-content FTS5 index keys on a rowid that VACUUM cannot renumber. The *_terms columns hold the adapter's
3
+ -- normalised terms, space-joined, so unicode61 sees exactly those tokens. The triggers keep the index in step.
4
+ CREATE TABLE `search_documents` (
5
+ `rid` integer PRIMARY KEY,
6
+ `id` text NOT NULL UNIQUE,
7
+ `type` text NOT NULL,
8
+ `fields` text NOT NULL,
9
+ `category_ids` text DEFAULT '[]' NOT NULL,
10
+ `name_terms` text DEFAULT '' NOT NULL,
11
+ `strong_terms` text DEFAULT '' NOT NULL,
12
+ `body_terms` text DEFAULT '' NOT NULL
13
+ );
14
+ --> statement-breakpoint
15
+ CREATE VIRTUAL TABLE `search_documents_fts` USING fts5(
16
+ name_terms,
17
+ strong_terms,
18
+ body_terms,
19
+ content='search_documents',
20
+ content_rowid='rid',
21
+ tokenize='unicode61'
22
+ );
23
+ --> statement-breakpoint
24
+ CREATE TRIGGER `search_documents_ai` AFTER INSERT ON `search_documents` BEGIN
25
+ INSERT INTO search_documents_fts (rowid, name_terms, strong_terms, body_terms)
26
+ VALUES (new.rid, new.name_terms, new.strong_terms, new.body_terms);
27
+ END;
28
+ --> statement-breakpoint
29
+ CREATE TRIGGER `search_documents_ad` AFTER DELETE ON `search_documents` BEGIN
30
+ INSERT INTO search_documents_fts (search_documents_fts, rowid, name_terms, strong_terms, body_terms)
31
+ VALUES ('delete', old.rid, old.name_terms, old.strong_terms, old.body_terms);
32
+ END;
33
+ --> statement-breakpoint
34
+ CREATE TRIGGER `search_documents_au` AFTER UPDATE ON `search_documents` BEGIN
35
+ INSERT INTO search_documents_fts (search_documents_fts, rowid, name_terms, strong_terms, body_terms)
36
+ VALUES ('delete', old.rid, old.name_terms, old.strong_terms, old.body_terms);
37
+ INSERT INTO search_documents_fts (rowid, name_terms, strong_terms, body_terms)
38
+ VALUES (new.rid, new.name_terms, new.strong_terms, new.body_terms);
39
+ END;