 
         try db.run(sysTable.insert(or: .replace,
             idColumn <- 0,
+            schemaVersionColumn <- schemaVersion,
             versionColumn <- 0
         ))
 

    }
    
    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)
        ))
    }
}


// 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>("dataset_version")
    let schemaVersionColumn = Expression<Int64>("schema_version")

    let quadsTable = SQLite.Table("quads")
    let subjColumn = Expression<Int64>("subject")
