ppx_rapper

Syntax extension for Caqti/PostgreSQL queries
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library ppx_rapper
Module Ppx_rapper
val parse_args : Base.String.t Base.List.t -> ( [> `Labelled_args | `Record ] * [> `Function | `Record | `Tuple ] * bool, string ) Base.result

Handle 'record_in' etc. in %rapper "SELECT * FROM USERS" record_in record_out

val component_expressions : loc:Ppxlib.location -> Ppx_rapper__Query.parsed_query -> Ppxlib_ast.Ast.expression * Ppxlib_ast.Ast.expression * Astlib.Ast_500.Parsetree.expression

Make some subexpressions to be used in generated code

val make_expand_get_and_exec_expression : loc:Ppxlib.Location.t -> Ppx_rapper__Query.parsed_query -> [ `Labelled_args | `Record ] -> [ `Tuple | `Record | `Function ] -> ( Ppxlib_ast.Ast.expression -> ( body_fn:( Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression ) -> loc:Ppxlib.Location.t -> Ppx_rapper__Codegen.extension_contents -> Ppxlib_ast.Ast.expression ) -> ( Ppxlib_ast.Ast.expression, Base.string ) Base.result ) * ( Ppxlib_ast.Ast.expression -> ( body_fn:( Ppxlib_ast.Ast.expression -> Ppxlib_ast.Ast.expression ) -> loc:Ppxlib.Location.t -> Ppx_rapper__Codegen.extension_contents -> Ppxlib_ast.Ast.expression ) -> ( Ppxlib_ast.Ast.expression, Base.string ) Base.result )

Make a function expand_get to produce the expressions for get_one, get_opt and get_many, and a similar expand_exec for execute

val expand_apply : loc:Ppxlib.Location.t -> path:'a -> string -> string -> Base.String.t Base.List.t -> Ppxlib_ast.Ast.expression
val expand_let : loc:Astlib.Location.t -> path:'a -> string -> string -> string -> Base.String.t Base.List.t -> Astlib.Ast_500.Parsetree.structure_item
val apply_pattern : unit -> ( Astlib.Ast_500.Parsetree.expression, string -> string -> string list -> 'a, 'b ) Ppxlib__Ast_pattern0.t

Captures [%rapper get_one "SELECT id FROM things WHERE condition"]

val let_pattern : unit -> ( Astlib.Ast_500.Parsetree.payload, string -> string -> string -> string list -> 'a, 'b ) Ppxlib__Ast_pattern0.t

Captures [let%rapper get_thing = get_one "SELECT id FROM things WHERE condition"]

val name : string
val apply_ext : Ppxlib.Extension.t
val let_ext : Ppxlib.Extension.t