mfp / ocaml-sqlexpr

Minimalistic syntax extension for type-safe, convenient execution of SQL statements.
Other
86 stars 17 forks source link

Warning 33: unused open Sqlexpr.Directives #33

Closed vog closed 5 years ago

vog commented 5 years ago

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}".