Skip to main content

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    /// Firebird 4+ `INT128` value.
28    Int128(i128),
29
30    Floating(f64),
31
32    Timestamp(chrono::NaiveDateTime),
33
34    Binary(Vec<u8>),
35
36    /// Only works in fb >= 3.0
37    Boolean(bool),
38
39    Null,
40}
41
42impl SqlType {
43    /// Returns `true` if the type is `NULL`
44    pub fn is_null(&self) -> bool {
45        matches!(self, Null)
46    }
47}