added more support for supabase-js
This commit is contained in:
@@ -406,11 +406,19 @@ fn rows_to_json(rows: Vec<sqlx::postgres::PgRow>) -> Vec<Value> {
|
||||
Value::Null
|
||||
}
|
||||
} else if type_name == "TIMESTAMP" {
|
||||
if let Ok(ts) = row.try_get::<chrono::NaiveDateTime, _>(name) {
|
||||
if let Ok(ts) = row.try_get::<chrono::NaiveDateTime, _>(name) {
|
||||
json!(ts.to_string())
|
||||
} else {
|
||||
Value::Null
|
||||
}
|
||||
} else if type_name == "VECTOR" {
|
||||
match row.try_get::<String, _>(name) {
|
||||
Ok(s) => {
|
||||
// Parse string "[1,2,3]" to JSON array
|
||||
serde_json::from_str(&s).unwrap_or(json!(s))
|
||||
},
|
||||
Err(_) => Value::Null,
|
||||
}
|
||||
} else {
|
||||
// Fallback for types that can't be directly read as String
|
||||
match row.try_get::<String, _>(name) {
|
||||
|
||||
Reference in New Issue
Block a user