vieter/src/db/db.v

22 lines
295 B
V

module db
import sqlite
struct VieterDb {
conn sqlite.DB
}
// init initializes a database & adds the correct tables.
pub fn init(db_path string) ?VieterDb {
conn := sqlite.connect(db_path)?
sql conn {
create table GitRepo
create table BuildLog
}
return VieterDb{
conn: conn
}
}