diff --git a/db/src/db.rs b/db/src/db.rs index fe87b002..5c6c33aa 100644 --- a/db/src/db.rs +++ b/db/src/db.rs @@ -271,89 +271,6 @@ pub fn create_current_version(conn: &mut rusqlite::Connection) -> Result { Ok(db) } -// (def v2-statements v1-statements) - -// (defn create-temp-tx-lookup-statement [table-name] -// // n.b., v0/value_type_tag0 can be NULL, in which case we look up v from datoms; -// // and the datom columns are NULL into the LEFT JOIN fills them in. -// // The table-name is not escaped in any way, in order to allow r#"temp.dotted" names. -// // TODO: update comment about sv. -// [(str r#"CREATE TABLE IF NOT EXISTS r#" table-name -// r#" (e0 INTEGER NOT NULL, a0 SMALLINT NOT NULL, v0 BLOB NOT NULL, tx0 INTEGER NOT NULL, added0 TINYINT NOT NULL, -// value_type_tag0 SMALLINT NOT NULL, -// index_avet0 TINYINT, index_vaet0 TINYINT, -// index_fulltext0 TINYINT, -// unique_value0 TINYINT, -// sv BLOB, -// svalue_type_tag SMALLINT, -// rid INTEGER, -// e INTEGER, a SMALLINT, v BLOB, tx INTEGER, value_type_tag SMALLINT)")]) - -// (defn create-temp-tx-lookup-eavt-statement [idx-name table-name] -// // Note that the consuming code creates and drops the indexes -// // manually, which makes insertion slightly faster. -// // This index prevents overlapping transactions. -// // The idx-name and table-name are not escaped in any way, in order -// // to allow r#"temp.dotted" names. -// // TODO: drop added0? -// [(str r#"CREATE UNIQUE INDEX IF NOT EXISTS r#"#, -// idx-name -// r#" ON r#"#, -// table-name -// r#" (e0, a0, v0, added0, value_type_tag0) WHERE sv IS NOT NULL")]) - -// (defn from-version 0)]} // Or we'd create-current-version instead. -// {:pre [(< from-version current-version)]} // Or we wouldn't need to update-from-version. -// (println r#"Upgrading database from" from-version r#"to" current-version) -// (s/in-transaction! -// db -// #(go-pair -// // We must only be migrating from v1 to v2. -// (let [statement r#"UPDATE parts SET idx = idx + 2 WHERE part = ?"] -// (try -// ( Result { if rusqlite::version_number() < MIN_SQLITE_VERSION { panic!("Mentat requires at least sqlite {}", MIN_SQLITE_VERSION);