open caqti_type; use Q module for discuss

This commit is contained in:
Swrup 2022-04-04 21:38:09 +02:00
parent 613d901bca
commit 0632a713c7
5 changed files with 115 additions and 162 deletions

View file

@ -18,14 +18,14 @@ module Db =
let () =
let set_foreign_keys_on =
(Caqti_type.unit ->. Caqti_type.unit) "PRAGMA foreign_keys = ON"
Caqti_type.(unit ->. unit) "PRAGMA foreign_keys = ON"
in
if Result.is_error (Db.exec set_foreign_keys_on ()) then
Dream.error (fun log -> log "can't set foreign_keys on")
let () =
let query =
(Caqti_type.unit ->. Caqti_type.unit)
Caqti_type.(unit ->. unit)
"CREATE TABLE IF NOT EXISTS dream_session (id TEXT PRIMARY KEY, label \
TEXT NOT NULL, expires_at REAL NOT NULL, payload TEXT NOT NULL)"
in