Something went wrong. Try again.
SQLite file format and SQL engine in pure OCaml
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556-- Catalog database for the sqlite3 query-interop traces.-- Mirrors oi's d10/index.ml schema (the engine's motivating consumer).-- Built by the sqlite3 CLI; read back by ocaml-sqlite. No floats are SELECTed-- in the queries, so column rendering matches sqlite3's list mode exactly.
CREATE TABLE layers ( hash TEXT PRIMARY KEY, os_key TEXT NOT NULL, arch TEXT NOT NULL, os TEXT NOT NULL, distro TEXT NOT NULL, os_version TEXT NOT NULL, package_name TEXT NOT NULL, package_ver TEXT NOT NULL, exit_status INTEGER NOT NULL, created REAL NOT NULL, overlay_handle TEXT, overlay_version TEXT, tarball_sha256 TEXT, tarball_size INTEGER);
CREATE TABLE layer_binaries ( layer_hash TEXT NOT NULL, binary_name TEXT NOT NULL);
INSERT INTO layers VALUES ('h1','linux-x86_64-debian-12','x86_64','linux','debian','12','cohttp','5.0.0',0,1000.0,NULL,NULL,NULL,NULL), ('h2','linux-x86_64-debian-12','x86_64','linux','debian','12','cohttp','6.0.0',0,1000.0,'myoverlay','1.0','abc123',100), ('h3','linux-x86_64-debian-12','x86_64','linux','debian','12','lwt','5.7.0',1,1000.0,NULL,NULL,NULL,NULL);
INSERT INTO layer_binaries VALUES ('h1','cohttp-server'), ('h2','cohttp-server'), ('h3','lwt-tool');
-- Three relations for the chain-of-outer-joins queries, carrying the shapes a-- chain gets wrong first: a key duplicated on both sides (k=2), a key present-- on one side only (k=1, 4, 5), and a NULL key in every table, which no-- equality matches and every outer join therefore pads. Separate tables, so-- the queries above read exactly the rows they always did.
CREATE TABLE chain_l (k INTEGER, v TEXT);CREATE TABLE chain_r (k INTEGER, w TEXT);CREATE TABLE chain_c (k INTEGER, u TEXT);
INSERT INTO chain_l VALUES (1,'l1'), (2,'l2'), (2,'l2b'), (3,'l3'), (NULL,'lnull');
INSERT INTO chain_r VALUES (2,'r2'), (2,'r2b'), (3,'r3'), (4,'r4'), (NULL,'rnull');
INSERT INTO chain_c VALUES (1,'c1'), (3,'c3'), (3,'c3b'), (5,'c5'), (NULL,'cnull');