2022-05-01 22:47:00 +02:00
|
|
|
module db
|
|
|
|
|
|
|
|
import sqlite
|
|
|
|
|
|
|
|
struct VieterDb {
|
|
|
|
conn sqlite.DB
|
|
|
|
}
|
|
|
|
|
2022-05-03 19:55:52 +02:00
|
|
|
// init initializes a database & adds the correct tables.
|
2022-05-01 22:47:00 +02:00
|
|
|
pub fn init(db_path string) ?VieterDb {
|
2022-05-14 20:06:08 +02:00
|
|
|
conn := sqlite.connect(db_path)?
|
2022-05-01 22:47:00 +02:00
|
|
|
|
|
|
|
sql conn {
|
|
|
|
create table GitRepo
|
2022-05-07 14:16:30 +02:00
|
|
|
create table BuildLog
|
2022-05-01 22:47:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return VieterDb{
|
|
|
|
conn: conn
|
|
|
|
}
|
|
|
|
}
|