rsfbclient_core/
lib.rs

1//! Types, traits and constants to abstract over the different
2//! implementations of the firebird client
3
4pub mod charset;
5mod connection;
6pub mod date_time;
7pub(crate) mod error;
8pub mod ibase;
9mod params;
10mod row;
11mod transaction;
12
13pub use charset::Charset;
14pub use connection::*;
15pub use error::FbError;
16pub use params::*;
17pub use row::*;
18pub use transaction::*;
19
20#[derive(Debug, Clone)]
21/// Sql parameter / column data
22pub enum SqlType {
23    Text(String),
24
25    Integer(i64),
26
27    Floating(f64),
28
29    Timestamp(chrono::NaiveDateTime),
30
31    Binary(Vec<u8>),
32
33    /// Only works in fb >= 3.0
34    Boolean(bool),
35
36    Null,
37}
38
39impl SqlType {
40    /// Returns `true` if the type is `NULL`
41    pub fn is_null(&self) -> bool {
42        matches!(self, Null)
43    }
44}