fraiseql_db/types/mod.rs
1//! Type definitions for fraiseql-db.
2
3pub mod db_types;
4pub mod sql_hints;
5
6// Re-export db types so `crate::types::DatabaseType` etc. still work
7#[cfg(feature = "postgres")]
8pub use db_types::QueryParam;
9pub use db_types::{DatabaseType, JsonbValue, PoolMetrics};
10// Re-export sql hint types
11pub use sql_hints::{OrderByClause, OrderDirection, SqlProjectionHint};
12
13use crate::dialect::RowViewColumnType;
14
15/// Column specification for row-shaped view queries (used by gRPC transport).
16#[derive(Debug, Clone)]
17pub struct ColumnSpec {
18 /// Column name.
19 pub name: String,
20 /// Column type for SQL casting.
21 pub column_type: RowViewColumnType,
22}
23
24/// A single database column value returned from a row-shaped view query.
25#[derive(Debug, Clone)]
26pub enum ColumnValue {
27 /// Text / varchar value.
28 Text(String),
29 /// 32-bit integer.
30 Int32(i32),
31 /// 64-bit integer.
32 Int64(i64),
33 /// 64-bit floating point.
34 Float64(f64),
35 /// Boolean.
36 Boolean(bool),
37 /// UUID as string.
38 Uuid(String),
39 /// Timestamp with timezone as string.
40 Timestamptz(String),
41 /// Date as string (YYYY-MM-DD).
42 Date(String),
43 /// JSON value as string.
44 Json(String),
45 /// Null value.
46 Null,
47}