@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.
- package/dist/{chunk-74KODSYJ.js → chunk-2GFZHF5W.js} +99 -16
- package/dist/chunk-2GFZHF5W.js.map +1 -0
- package/dist/index.d.ts +99 -31
- package/dist/index.js +1161 -518
- package/dist/index.js.map +1 -1
- package/dist/{register-IVFYBJSX.js → register-FJA7YJV3.js} +2 -2
- package/migrations/postgres/0007_native_search.sql +12 -0
- package/migrations/postgres/meta/0007_snapshot.json +1598 -0
- package/migrations/postgres/meta/_journal.json +7 -0
- package/migrations/sqlite/0007_native_search.sql +39 -0
- package/migrations/sqlite/meta/0007_snapshot.json +1470 -0
- package/migrations/sqlite/meta/_journal.json +7 -0
- package/package.json +33 -11
- package/recipes/postgres.json +17 -0
- package/dist/chunk-74KODSYJ.js.map +0 -1
- /package/dist/{register-IVFYBJSX.js.map → register-FJA7YJV3.js.map} +0 -0
|
@@ -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;
|