qusql-mysql-type
Proc macros to perform type typed mysql queries on top of qusql-mysql.
The queries are typed based on a schema definition, that must be placed in "qusql-mysql-type-schema.sql" in the root of a using crate:
IF EXISTS `t1`;
(
`id` int(11) NOT NULL,
`cbool` tinyint(1) NOT NULL DEFAULT false,
`cu8` tinyint UNSIGNED NOT NULL DEFAULT 0,
`cu16` smallint UNSIGNED NOT NULL DEFAULT 1,
`cu32` int UNSIGNED NOT NULL DEFAULT 2,
`cu64` bigint UNSIGNED NOT NULL DEFAULT 3,
`ci8` tinyint,
`ci16` smallint,
`ci32` int,
`ci64` bigint,
`ctext` varchar(100) NOT NULL,
`cbytes` blob,
`cf32` float,
`cf64` double
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`t1`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
See qusql_type::schema for a detailed description.
This schema can then be used to type queries:
use ;
use ;
use ;
async
See also the examples:
examples/qusql-mysql-type-notes: simple introductory CLI (single-table schema)examples/qusql-mysql-type-books: library catalog with JOINs, enums, dates, and an idempotent migration pattern