sql-table
Makes no-ORM querying of SQL databases more concise.
Examples
Basic usage:
use ;
table!;
assert_eq!;
If you need more sophisticated behaviour:
use ;
// If you want a specific table identifiers to be displayed by default as quoted
// just add `quote` parameter after table definition.
table!;
table!;
// Identifiers can also be unquoted using `.unquoted()` method,
// or, in case of field names, they can be converted into qualified form
// using `.qualified()` method of trait `Qualified` provided by this library
// and implemented for all fields of each generated table.
// Said methods can also be chained `.unquoted().qualified()`.
assert_eq!;
// Format: fk_<target table>_<target field>_<source table>_<source field>
// The whole name will get quoted if any of it's components (table/field names) are quoted.
// In this case quotation will be done using the first found quote
// of corresponding components listed in the key name.
assert_eq!;
assert_eq!;
// Format: ix_<table>_<field 1>_<field 2>_..._<field n>
// All fields must be either quoted or unquoted.
// The whole name will get quoted if either table or fields are quoted.
assert_eq!;
assert_eq!;
assert_eq!;
// If you need a different naming format for foreign keys, indices or anything else
// you can implement custom `IndexName`, `ForeignKeyName`, etc. traits
// using provided by this library default implementations as a reference.