drizzle_postgres/
common.rs1use drizzle_core::schema::SQLEnumInfo;
2use drizzle_core::traits::SQLViewInfo;
3use drizzle_core::{SQLIndexInfo, SQLSchemaType};
4
5#[derive(Debug, Clone)]
7pub enum PostgresSchemaType {
8 Table(&'static drizzle_core::TableRef),
10 View(&'static dyn SQLViewInfo),
12 Index(&'static dyn SQLIndexInfo),
14 Trigger,
16 Enum(&'static dyn SQLEnumInfo),
18}
19
20impl SQLSchemaType for PostgresSchemaType {}
21
22#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
28pub enum Number {
29 Integer(i64),
31 Real(f64),
33}
34
35impl Default for Number {
36 fn default() -> Self {
37 Self::Integer(Default::default())
38 }
39}
40
41impl From<i64> for Number {
42 fn from(value: i64) -> Self {
43 Self::Integer(value)
44 }
45}
46
47impl From<f64> for Number {
48 fn from(value: f64) -> Self {
49 Self::Real(value)
50 }
51}
52
53#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
55pub enum PostgresTransactionType {
56 ReadUncommitted,
58 #[default]
60 ReadCommitted,
61 RepeatableRead,
63 Serializable,
65}
66
67impl core::fmt::Display for PostgresTransactionType {
68 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
69 let level = match self {
70 Self::ReadUncommitted => "READ UNCOMMITTED",
71 Self::ReadCommitted => "READ COMMITTED",
72 Self::RepeatableRead => "REPEATABLE READ",
73 Self::Serializable => "SERIALIZABLE",
74 };
75 write!(f, "{level}")
76 }
77}
78
79pub use drizzle_core::{Join, JoinType};