1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Module used which provides marker types for use with the `Type` associated
//! type in [`FromColumn`] or [`FromUnsizedColumn`].
//!
//! These marker types determine what the supported column type is used when
//! reading a particular value.
//!
//! [`FromColumn`]: crate::FromColumn
//! [`FromUnsizedColumn`]: crate::FromUnsizedColumn
//!
//! # Examples
//!
//! ```
//! use sqll::{Connection, FromColumn, Result, Statement};
//! use sqll::ty;
//!
//! #[derive(Debug, PartialEq, Eq)]
//! struct Timestamp {
//! seconds: i64,
//! }
//!
//! impl FromColumn<'_> for Timestamp {
//! type Type = ty::Nullable<ty::Integer>;
//!
//! #[inline]
//! fn from_column(stmt: &Statement, index: ty::Nullable<ty::Integer>) -> Result<Self> {
//! Ok(Timestamp {
//! seconds: Option::<i64>::from_column(stmt, index)?.unwrap_or(i64::MIN),
//! })
//! }
//! }
//!
//! let c = Connection::open_in_memory()?;
//!
//! c.execute(r#"
//! CREATE TABLE test (ts INTEGER);
//!
//! INSERT INTO test (ts) VALUES (1767675413), (NULL);
//! "#)?;
//!
//! let mut stmt = c.prepare("SELECT ts FROM test")?;
//!
//! assert_eq!(stmt.next::<Timestamp>()?, Some(Timestamp { seconds: 1767675413 }));
//! assert_eq!(stmt.next::<Timestamp>()?, Some(Timestamp { seconds: i64::MIN }));
//! # Ok::<_, sqll::Error>(())
//! ```
pub use NotNull;
pub use AnyKind;
pub use ;