pub fn owned_table<S: Scalar>(
iter: impl IntoIterator<Item = (Ident, OwnedColumn<S>)>,
) -> OwnedTable<S>
Expand description
Creates an OwnedTable
from a list of (Ident, OwnedColumn)
pairs.
This is a convenience wrapper around OwnedTable::try_from_iter
primarily for use in tests and
intended to be used along with the other methods in this module (e.g. bigint, boolean, etc).
The function will panic under a variety of conditions. See OwnedTable::try_from_iter
for more details.
§Example
use proof_of_sql::base::{database::owned_table_utility::*};
let result = owned_table::<MyScalar>([
bigint("a", [1, 2, 3]),
boolean("b", [true, false, true]),
int128("c", [1, 2, 3]),
scalar("d", [1, 2, 3]),
varchar("e", ["a", "b", "c"]),
decimal75("f", 12, 1, [1, 2, 3]),
]);
///
§Panics
- Panics if converting the iterator into an
OwnedTable<S>
fails.