fix(db): complete PostgreSQL integration in validation and cleaner services
OrderNumberResolver, validation, and cleaner services had incomplete PostgreSQL support - they only handled SQL Server and MySQL, causing PostgreSQL to fall through to MySQL code paths with invalid syntax (backticks, ? placeholders) and missing schema.table name splitting. Changes: - Add PostgreSQL SQL generation ($N params, double-quoted identifiers) in OrderNumberResolver, validation-application-service, production-input-service, and validation-database - Add PostgreSQL to database factory functions in validation-database and cleaner-application-service - Add UPPER, LOWER, and 40+ common SQL functions to SQL_KEYWORDS to prevent prepareSql() from quoting them as identifiers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -238,6 +238,53 @@ const SQL_KEYWORDS = new Set([
|
||||
'FIRST',
|
||||
'LAST',
|
||||
|
||||
// ==================== Scalar & String Functions ====================
|
||||
'UPPER',
|
||||
'LOWER',
|
||||
'TRIM',
|
||||
'LTRIM',
|
||||
'RTRIM',
|
||||
'BTRIM',
|
||||
'SUBSTRING',
|
||||
'CONCAT',
|
||||
'LENGTH',
|
||||
'CHAR_LENGTH',
|
||||
'CHARACTER_LENGTH',
|
||||
'REPLACE',
|
||||
'POSITION',
|
||||
'OVERLAY',
|
||||
'LPAD',
|
||||
'RPAD',
|
||||
'REPEAT',
|
||||
'REVERSE',
|
||||
'SPLIT_PART',
|
||||
'INITCAP',
|
||||
'NORMALIZE',
|
||||
'CHR',
|
||||
'ASCII',
|
||||
'FORMAT',
|
||||
|
||||
// ==================== Numeric Functions ====================
|
||||
'ABS',
|
||||
'CEIL',
|
||||
'CEILING',
|
||||
'FLOOR',
|
||||
'ROUND',
|
||||
'POWER',
|
||||
'SQRT',
|
||||
'MOD',
|
||||
'SIGN',
|
||||
'TRUNC',
|
||||
|
||||
// ==================== Date/Time Functions ====================
|
||||
'EXTRACT',
|
||||
'DATE_TRUNC',
|
||||
'TO_CHAR',
|
||||
'TO_DATE',
|
||||
'TO_TIMESTAMP',
|
||||
'TO_NUMBER',
|
||||
'AGE',
|
||||
|
||||
// ==================== Pattern Matching ====================
|
||||
'BETWEEN',
|
||||
'LIKE',
|
||||
|
||||
Reference in New Issue
Block a user