add db, user registering into db, format
This commit is contained in:
parent
a24e59ed04
commit
a951a7584a
6 changed files with 91 additions and 40 deletions
13
src/db.ml
Normal file
13
src/db.ml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
let db_root = App.data_dir
|
||||
|
||||
let () =
|
||||
match Bos.OS.Dir.create (Fpath.v db_root) with
|
||||
| Ok true -> Dream.log "created %s" db_root
|
||||
| Ok false -> Dream.log "%s already exists" db_root
|
||||
| Error (`Msg _) ->
|
||||
Dream.warning (fun log -> log "error when creating %s" db_root)
|
||||
|
||||
let db = Filename.concat db_root "permap.db"
|
||||
|
||||
let with_db ?mode ?mutex ?cache ?vfs ?timeout f =
|
||||
Sqlite3_utils.with_db ?mode ?mutex ?cache ?vfs ?timeout db f
|
||||
Loading…
Add table
Add a link
Reference in a new issue