change 'cache' to 'searchtable' in database

This commit is contained in:
Peter McGoron 2021-08-10 10:22:05 -04:00
parent 547e5824e9
commit 47eed18958

View file

@ -1,7 +1,7 @@
(** Init script for the SQLite database. **) (** Init script for the SQLite database. **)
let inits = "\ let inits = "\
DROP TABLE IF EXISTS elements; \ DROP TABLE IF EXISTS elements; \
DROP TABLE IF EXISTS cache; \ DROP TABLE IF EXISTS searchtable; \
CREATE TABLE elements ( \ CREATE TABLE elements ( \
num INTEGER PRIMARY KEY NOT NULL, \ num INTEGER PRIMARY KEY NOT NULL, \
symb TEXT UNIQUE NOT NULL, \ symb TEXT UNIQUE NOT NULL, \
@ -11,7 +11,7 @@ let inits = "\
oxidation TEXT, state TEXT, \ oxidation TEXT, state TEXT, \
melting FLOAT, boiling FLOAT, density FLOAT, \ melting FLOAT, boiling FLOAT, density FLOAT, \
block TEXT, discovered INTEGER) WITHOUT ROWID; \ block TEXT, discovered INTEGER) WITHOUT ROWID; \
CREATE TABLE cache ( \ CREATE TABLE searchtable ( \
name TEXT PRIMARY KEY NOT NULL, \ name TEXT PRIMARY KEY NOT NULL, \
dat BLOB NOT NULL) WITHOUT ROWID; \ dat BLOB NOT NULL) WITHOUT ROWID; \
" "
@ -84,6 +84,6 @@ let makedb db json = let open Sqlite3
let stmt = "INSERT INTO cache VALUES (:name, :cache);" let stmt = "INSERT INTO cache VALUES (:name, :cache);"
|> prepare db |> prepare db
in in
do_model stmt "symbs" !symbs; do_model stmt "symb" !symbs;
do_model stmt "names" !names; do_model stmt "name" !names;
finalize stmt |> Rc.check finalize stmt |> Rc.check