use crate::databases::types::FieldType;
use super::SqlDialect;
pub struct SurrealDialect;
impl SqlDialect for SurrealDialect {
fn map_type(&self, field_type: &FieldType) -> String {
match field_type {
FieldType::Utf8 => "string".to_string(),
FieldType::Int32 => "int".to_string(),
FieldType::Int64 => "int".to_string(),
FieldType::UInt32 => "int".to_string(),
FieldType::UInt64 => "int".to_string(),
FieldType::Float32 => "float".to_string(),
FieldType::Float64 => "float".to_string(),
FieldType::Boolean => "bool".to_string(),
FieldType::Vector(n) => format!("array<float, {}>", n),
}
}
fn placeholder(&self, n: usize) -> String {
format!("${}", n)
}
fn quote_ident(&self, ident: &str) -> String {
format!("\"{}\"", ident)
}
}