Skip to content

Commit 97135bf

Browse files
committed
wip
1 parent 63edf5a commit 97135bf

File tree

63 files changed

+2584
-881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2584
-881
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
-- Remove id columns from package tables and use (owner, modules, name) as primary key
2+
-- Keep hash as a regular indexed column for structure-based lookups
3+
4+
-- Recreate package_types_v0 with composite primary key
5+
DROP TABLE package_types_v0;
6+
CREATE TABLE package_types_v0 (
7+
owner TEXT NOT NULL,
8+
modules TEXT NOT NULL,
9+
name TEXT NOT NULL,
10+
hash TEXT NOT NULL,
11+
pt_def BLOB,
12+
rt_def BLOB,
13+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
14+
PRIMARY KEY (owner, modules, name)
15+
);
16+
17+
-- Recreate package_values_v0 with composite primary key
18+
DROP TABLE package_values_v0;
19+
CREATE TABLE package_values_v0 (
20+
owner TEXT NOT NULL,
21+
modules TEXT NOT NULL,
22+
name TEXT NOT NULL,
23+
hash TEXT NOT NULL,
24+
pt_def BLOB,
25+
rt_dval BLOB,
26+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
27+
PRIMARY KEY (owner, modules, name)
28+
);
29+
30+
-- Recreate package_functions_v0 with composite primary key
31+
DROP TABLE package_functions_v0;
32+
CREATE TABLE package_functions_v0 (
33+
owner TEXT NOT NULL,
34+
modules TEXT NOT NULL,
35+
name TEXT NOT NULL,
36+
hash TEXT NOT NULL,
37+
pt_def BLOB,
38+
rt_instrs BLOB,
39+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
40+
PRIMARY KEY (owner, modules, name)
41+
);
42+
43+
-- Create indexes for efficient hash-based lookups
44+
CREATE INDEX IF NOT EXISTS idx_package_types_hash ON package_types_v0(hash);
45+
CREATE INDEX IF NOT EXISTS idx_package_values_hash ON package_values_v0(hash);
46+
CREATE INDEX IF NOT EXISTS idx_package_functions_hash ON package_functions_v0(hash);
98 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)