Skip to main content

Crate rbatis_codegen

Crate rbatis_codegen 

Source
Expand description

Compile time dynamic SQL generator.

This is the compiler behind #[py_sql], #[html_sql] and #[sql] (provided by the rbatis-macro-driver crate and re-exported as rbatis::rbatis_codegen). A dynamic SQL template is parsed here and turned into plain Rust source code, which is then compiled by the rustc invocation that is already running. That is why a query written in py_sql/html_sql runs as fast as hand written SQL: nothing is interpreted at runtime.

Most users never depend on this crate directly; it is documented because it is re-exported from rbatis.

Re-exports§

pub use into_sql::IntoSql;
pub use codegen::rb_html;
pub use codegen::rb_py;

Modules§

codegen
parsers and code generators of the py_sql and html_sql languages
error
error type of the code generator
from_bool
bool helpers available inside a template expression
into_sql
rendering a value as SQL, used by ${arg} interpolation
ops
operators (+, ==, .sql(), …) usable inside a template
ops_add
+ operator
ops_bit_and
& (bit and) operator
ops_bit_or
| (bit or) operator
ops_cmp
comparison operators (>, <, >=, <=)
ops_div
/ operator
ops_eq
== operator
ops_mul
* operator
ops_neg
unary - operator
ops_not
! operator
ops_rem
% operator
ops_shl
<< operator
ops_shr
>> operator
ops_string
string helpers (.sql(), .csv(), …)
ops_sub
- operator
ops_xor
^ operator