fix(db/postgres): Resolve SQL identifier casing issues
Improves SQL query execution by ensuring proper casing for identifiers across various database types, particularly for Postgres. Enhances security and compatibility by using an identifier escaping method, preventing potential errors due to case sensitivity in SQL queries. Addresses potential issues with existing queries for better reliability and consistency.
This commit is contained in:
parent
69b98980f1
commit
2d839e3609
9 changed files with 81 additions and 47 deletions
|
|
@ -79,9 +79,7 @@ public class PostgresQueryCreator : GenericQueryCreator
|
|||
.Where(c => c.Unique).Select(c => $"\"{c.Name}\"")
|
||||
.ToArray(); // No re-enumeration
|
||||
|
||||
return "CREATE TABLE {0} ({1} {2})".SFormat(EscapeTableName(table.Name),
|
||||
string.Join(", ", columns),
|
||||
uniques.Any() ? ", UNIQUE({0})".SFormat(string.Join(", ", uniques)) : "");
|
||||
return $"CREATE TABLE {EscapeTableName(table.Name)} ({string.Join(", ", columns)} {(uniques.Any() ? ", UNIQUE({0})".SFormat(string.Join(", ", uniques)) : "")})";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue