The PPX generated code for SQL statements produces OCaml warnings, which is especially annoying for developers like myself, who prefer to enable all warnings during development, and turn them into errors.
This is a simple program to reproduce this issue:
module Sqlexpr = Sqlexpr_sqlite.Make(Sqlexpr_concurrency.Id)
let test = [%sqlc "select 1"]
Result:
File "Test.ml", line 2, characters 13-17:
Warning 33: unused open Sqlexpr.Directives.
The following more realistic program produces the same warning:
module Sqlexpr = Sqlexpr_sqlite.Make(Sqlexpr_concurrency.Id)
let db = Sqlexpr.open_db ":memory:"
let one = Sqlexpr.select_one db [%sqlc "select @d{1}"]
Also, the same happens for [%sqlinit "..."].
The warning does not appear for statements with parameters, such as [%sqlc "select a from t where b = %s{b}".
The PPX generated code for SQL statements produces OCaml warnings, which is especially annoying for developers like myself, who prefer to enable all warnings during development, and turn them into errors.
This is a simple program to reproduce this issue:
Result:
The following more realistic program produces the same warning:
Also, the same happens for
[%sqlinit "..."]
.The warning does not appear for statements with parameters, such as
[%sqlc "select a from t where b = %s{b}"
.