[backend]
name = "rust-sqlx"
language = "rust"
file_extension = "rs"
engine = "redshift"
description = "Rust code generation targeting sqlx with Redshift"
[types.scalars]
bool = "bool"
int16 = "i16"
int32 = "i32"
int64 = "i64"
float32 = "f32"
float64 = "f64"
string = "String"
bytes = "Vec<u8>"
uuid = "uuid::Uuid"
decimal = "rust_decimal::Decimal"
date = "chrono::NaiveDate"
time = "chrono::NaiveTime"
time_tz = "sqlx::postgres::types::PgTimeTz"
datetime = "chrono::NaiveDateTime"
datetime_tz = "chrono::DateTime<chrono::Utc>"
interval = "sqlx::postgres::types::PgInterval"
json = "serde_json::Value"
inet = "ipnetwork::IpNetwork"
super = "serde_json::Value"
geometry = "String"
[types.containers]
array = "Vec<{T}>"
nullable = "Option<{T}>"
json_typed = "sqlx::types::Json<{T}>"
[naming]
struct_case = "PascalCase"
fn_case = "snake_case"
enum_variant_case = "PascalCase"
row_suffix = "Row"
sanitize_field_names = true
reserved = [
"as",
"async",
"await",
"break",
"const",
"continue",
"crate",
"dyn",
"else",
"enum",
"extern",
"false",
"fn",
"for",
"if",
"impl",
"in",
"let",
"loop",
"match",
"mod",
"move",
"mut",
"pub",
"ref",
"return",
"self",
"static",
"struct",
"super",
"trait",
"true",
"type",
"unsafe",
"use",
"where",
"while",
"abstract",
"become",
"box",
"do",
"final",
"macro",
"override",
"priv",
"try",
"typeof",
"unsized",
"virtual",
"yield",
]
[imports.rules]
"chrono::" = "use chrono;"
"uuid::Uuid" = "use uuid::Uuid;"
"rust_decimal::" = "use rust_decimal::Decimal;"
"serde_json::" = "use serde_json;"
"ipnetwork::" = "use ipnetwork::IpNetwork;"