SqlComposer
other items defined
module Delete
SqlComposer.Delete
Generate composable SQL Delete queries and query fragments.
Here is a basic example:
let sql =
SqlComposer.Delete.(
make()
|. from("test")
|. where("AND test.foo = ?")
|. toSql
);
Js.log2("SQL: ", sql);
[@@@ocaml.ppx.context { cookies = [] }]
open SqlComposer
let sql =
let open SqlComposer.Delete in
(((make ()) |. (from (("test")[@reason.raw_literal "test"]))) |.
(where (("AND test.foo = ?")[@reason.raw_literal "AND test.foo = ?"])))
|. toSql
let _ = Js.log2 (("SQL: ")[@reason.raw_literal "SQL: "]) sql
other items defined
type t
module Select
SqlComposer.Select
Generate composable SQL Select queries and query fragments.
Here is a basic example:
let sql =
SqlComposer.Select.(
make()
|. field("*")
|. from("test")
|. where("AND test.foo = ?")
|. toSql
);
Js.log2("SQL: ", sql);
[@@@ocaml.ppx.context { cookies = [] }]
open SqlComposer
let sql =
let open SqlComposer.Select in
((((make ()) |. (field (("*")[@reason.raw_literal "*"]))) |.
(from (("test")[@reason.raw_literal "test"])))
|.
(where (("AND test.foo = ?")[@reason.raw_literal "AND test.foo = ?"])))
|. toSql
let _ = Js.log2 (("SQL: ")[@reason.raw_literal "SQL: "]) sql
other items defined
type t
module Update
SqlComposer.Update
Generate composable SQL Update statements and fragments.
Here is a basic example:
let sql =
SqlComposer.Update.(
make()
|. from("test")
|. set("foo", "?")
|. set("bar", "?")
|. where({|AND moo = "cow"|})
|. toSql
);
Js.log2("SQL: ", sql);
[@@@ocaml.ppx.context { cookies = [] }]
open SqlComposer
let sql =
let open SqlComposer.Update in
(((((make ()) |. (from (("test")[@reason.raw_literal "test"]))) |.
(set (("foo")[@reason.raw_literal "foo"])
(("?")[@reason.raw_literal "?"])))
|.
(set (("bar")[@reason.raw_literal "bar"])
(("?")[@reason.raw_literal "?"])))
|. (where {|AND moo = "cow"|}))
|. toSql
let _ = Js.log2 (("SQL: ")[@reason.raw_literal "SQL: "]) sql
other items defined
type t
module Conversion
This module does not have a toplevel documentation block.