pub struct Record<ST: 'static>(_);
Record (a.k.a. tuple) SQL type.
- Any tuple which can be serialized to each of the elements (note: There are major caveats, see the section below)
- Any tuple which can be deserialized from each of the elements.
Typically in the documentation for SQL types, we use “
as a shorthand for “Rust types that you can use to represent this type”.
For every other type, that means there is specifically an implementation
However, PostgreSQL does not support transmission of anonymous record
types as bind parameters. It only supports transmission for named
composite types. For this reason, if you tried to do
int_tuple_col.eq((1, 2)), we will generate the SQL
int_tuple_col = ($1, $2) rather than
int_tuple_col = $1 as we would for anything
This should not be visible during normal usage. The only time this would
affect you is if you were attempting to use
sql_query with tuples.
Your code would not compile in that case, as the
ToSql trait itself is
You can implement
ToSql for named composite types. See