mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
refactor: Simplified absolute path resolution code.
This commit is contained in:
4
db.odin
4
db.odin
@@ -305,7 +305,11 @@ db_insert :: proc(db: ^Db, file: EnvFile) -> bool {
|
||||
}
|
||||
|
||||
// Result will be freed when `db_close` is called.
|
||||
//
|
||||
// Expects an absolute path
|
||||
db_fetch :: proc(db: ^Db, path: string) -> (EnvFile, bool) {
|
||||
assert(os.is_absolute_path(path))
|
||||
|
||||
sql: cstring = "SELECT path, remotes, sha256, contents FROM envr_env_files WHERE path = ?"
|
||||
stmt: sqlite.Stmt
|
||||
rc := sqlite.prepare_v2(db.conn, sql, -1, &stmt, nil)
|
||||
|
||||
Reference in New Issue
Block a user