orm(PostgreSQLDialect): double-quote column names in INSERT field lists
This commit is contained in:
parent
b1ea489ccb
commit
5a9283ad85
@ -230,7 +230,7 @@ export class PostgreSQLDialect extends SQLDialect {
|
|||||||
const table: string = tableString.split('.').map(x => `"${x}"`)
|
const table: string = tableString.split('.').map(x => `"${x}"`)
|
||||||
.join('.')
|
.join('.')
|
||||||
queryLines.push('INSERT INTO ' + (typeof source === 'string' ? table : `${table} AS "${source.alias}"`)
|
queryLines.push('INSERT INTO ' + (typeof source === 'string' ? table : `${table} AS "${source.alias}"`)
|
||||||
+ (columns.length ? ` (${columns.join(', ')})` : ''))
|
+ (columns.length ? ` (${columns.map(x => `"${x}"`).join(', ')})` : ''))
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Array.isArray(data) && !data.length ) {
|
if ( Array.isArray(data) && !data.length ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user