 // swiftlint:disable:next type_body_length
 open class SQLiteQuadStore: Sequence, MutableQuadStoreProtocol {
     typealias TermID = Int64
+    let schemaVersion : Int64 = 1
     let sysTable = SQLite.Table("kineo_sys")
-    let versionColumn = Expression<Int64>("version")
+    let versionColumn = Expression<Int64>("dataset_version")
+    let schemaVersionColumn = Expression<Int64>("schema_version")
 
     let quadsTable = SQLite.Table("quads")
     let subjColumn = Expression<Int64>("subject")

    }
    
    public func load<S: Sequence>(version: Version, quads: S) throws where S.Iterator.Element == Quad {
        for q in quads {
            let sid = try assignID(for: q.subject)
            let pid = try assignID(for: q.predicate)
            let oid = try assignID(for: q.object)
            let gid = try assignID(for: q.graph)
            try db.run(quadsTable.insert(or: .ignore, subjColumn <- sid, predColumn <- pid, objColumn <- oid, graphColumn <- gid))
        }
        try db.run(sysTable.insert(or: .replace,
                                   idColumn <- 0,
                                   versionColumn <- Int64(version)
        ))
    }
}


    internal func initializeTables() throws {
        try db.run(sysTable.create { t in     // CREATE TABLE "kineo_sys" (
            t.column(idColumn, primaryKey: .autoincrement) //     "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
            t.column(schemaVersionColumn) //     "schema_version" INTEGER NOT NULL,
            t.column(versionColumn) //     "dataset_version" INTEGER NOT NULL,
            // )
        })
        
