Fixed insert
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::{fmt, sync::OnceLock, time::Duration};
|
||||
use std::fmt::Display;
|
||||
use chrono::{DateTime, Utc};
|
||||
use redis::{aio::MultiplexedConnection as RedisConnection, Client as RedisClient, RedisResult};
|
||||
use sqlx::{postgres::PgPoolOptions, Pool, Postgres};
|
||||
use crate::error::SirenResult;
|
||||
@@ -11,6 +12,7 @@ pub mod insert;
|
||||
pub mod messages;
|
||||
pub mod query;
|
||||
pub mod update;
|
||||
mod executable_query;
|
||||
|
||||
static POOL: OnceLock<Pool<Postgres>> = OnceLock::new();
|
||||
static REDIS: OnceLock<RedisClient> = OnceLock::new();
|
||||
@@ -102,6 +104,8 @@ pub enum Value {
|
||||
OptionalBool(Option<bool>),
|
||||
Text(String),
|
||||
OptionalText(Option<String>),
|
||||
DateTime(DateTime<Utc>),
|
||||
OptionalDateTime(Option<DateTime<Utc>>),
|
||||
}
|
||||
|
||||
impl Display for Value {
|
||||
@@ -125,6 +129,9 @@ impl Display for Value {
|
||||
Value::Text(s) => write!(f, "'{}'", s.replace("'", "''")),
|
||||
Value::OptionalText(Some(s)) => write!(f, "'{}'", s.replace("'", "''")),
|
||||
Value::OptionalText(None) => write!(f, "NULL"),
|
||||
Value::DateTime(n) => write!(f, "{}", n),
|
||||
Value::OptionalDateTime(Some(n)) => write!(f, "{}", n),
|
||||
Value::OptionalDateTime(None) => write!(f, "NULL"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user