qusql-type
Type SQL statements
This crate provides a facility to process a SQL schema definition, and then use that definition to type the argument and return value of SQL statements. Both MariaDB/MySQL and PostgreSQL are well supported.
Example code:
use ;
let schemas = "
CREATE TABLE `events` (
`id` bigint(20) NOT NULL,
`user` int(11) NOT NULL,
`message` text NOT NULL
);";
let mut issues = new;
let schemas = parse_schemas;
assert!;
let sql = "SELECT `id`, `user`, `message` FROM `events` WHERE `id` = ?";
let mut issues = new;
let stmt = type_statement;
assert!;
match stmt ;
See also: examples/qusql-type-check - a
command-line tool that prints the inferred types for a set of queries against a
given schema.