Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about common sqlite scheme mistake #92

Merged
merged 1 commit into from
Jul 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/sql/sql.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ let sql_pool ?size uri =
begin match !pool_cell with
| Some pool -> inner_handler (Dream.with_local pool_variable pool request)
| None ->
let parsed_uri = Uri.of_string uri in
if Uri.scheme parsed_uri = Some "sqlite" then
log.warning (fun log -> log ~request
"Dream.sql_pool: 'sqlite' is not a valid scheme; did you mean 'sqlite3'?");
let pool =
Caqti_lwt.connect_pool ?max_size:size ~post_connect (Uri.of_string uri) in
Caqti_lwt.connect_pool ?max_size:size ~post_connect parsed_uri in
match pool with
| Ok pool ->
pool_cell := Some pool;
Expand Down