Fix schema search path
This commit is contained in:
parent
5a0ad8cc53
commit
9deef4f9af
@ -78,9 +78,16 @@ impl SqlxPostgresConnector {
|
|||||||
}
|
}
|
||||||
let set_search_path_sql = options.schema_search_path.as_ref().map(|schema| {
|
let set_search_path_sql = options.schema_search_path.as_ref().map(|schema| {
|
||||||
let mut string = "SET search_path = ".to_owned();
|
let mut string = "SET search_path = ".to_owned();
|
||||||
for schema in schema.split(',') {
|
for (i, schema) in schema.split(',').enumerate() {
|
||||||
|
if i > 0 {
|
||||||
|
write!(&mut string, ",").unwrap();
|
||||||
|
}
|
||||||
|
if schema.starts_with('"') {
|
||||||
|
write!(&mut string, "{schema}").unwrap();
|
||||||
|
} else {
|
||||||
write!(&mut string, "\"{schema}\"").unwrap();
|
write!(&mut string, "\"{schema}\"").unwrap();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
string
|
string
|
||||||
});
|
});
|
||||||
let lazy = options.connect_lazy;
|
let lazy = options.connect_lazy;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user