Module Rel_sql.Syntax

Standard SQL syntax fragments.

val string_to_literal : string -> string

string_to_literal s is s between single quotes ('\'') with single quotes in s properly escaped.

val string_of_literal : string -> (string, string) Stdlib.result

string_of_literal s parses a string literal from s. This removes enclosing single quotes ('\'') and collapses sequences of two quotes to a single one (it leaves lone internal single quotes untouched).

val id : string -> string

id id is id between double quotes ('\"') with double quotes in s properly escaped.

val id_in_schema : ?schema:string -> string -> string

id_in_schema is like id but prefixes an escaped schema if specified.

val sort_order_keyword : [ `Asc | `Desc ] -> string
val foreign_key_action_keyword : Rel.Table.Foreign_key.action -> string