cleanup user.ml, add plant.ml

This commit is contained in:
Swrup 2021-12-22 11:27:53 +01:00
parent dfb193476f
commit d647486ad8
6 changed files with 255 additions and 234 deletions

View file

@ -9,5 +9,15 @@ let () =
let db = Filename.concat db_root "permap.db"
let random_state = Random.State.make_self_init ()
let with_db ?mode ?mutex ?cache ?vfs ?timeout f =
Sqlite3_utils.with_db ?mode ?mutex ?cache ?vfs ?timeout db f
module Db =
( val Caqti_blocking.connect (Uri.of_string ("sqlite3://" ^ db))
|> Caqti_blocking.or_fail )
(* TODO do image validation: length and MIME types with conan*)
(* TODO do the same for text input: check length, forbidden chars and have a forbidden words filter*)
let is_valid_image _content = true