Skip to content

Commit 02a3f6e

Browse files
authored
🔀 Merge pull request #57 from david-pivonka/fix/postgres-case-sensitive-columns
fix(postgres): Handle case-sensitive column names
2 parents 54bb289 + 8c1d033 commit 02a3f6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎module/postgres.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func (m *PostgresModule) Connect(c *sqlite3.SQLiteConn, args []string) (sqlite3.
240240
defaultValue = ""
241241
}
242242

243-
localColumnName := transformSQLiteValidName(columnName)
243+
localColumnName := fmt.Sprintf(`"%s"`, transformSQLiteValidName(columnName))
244244
if !firstRow {
245245
schema.WriteString(",\n")
246246
}
@@ -250,9 +250,9 @@ func (m *PostgresModule) Connect(c *sqlite3.SQLiteConn, args []string) (sqlite3.
250250
primaryKeys = append(primaryKeys, localColumnName)
251251
}
252252

253-
schema.WriteString(fmt.Sprintf(" \"%s\" %s", localColumnName, columnType))
253+
schema.WriteString(fmt.Sprintf(" %s %s", localColumnName, columnType))
254254
internalSchema = append(internalSchema, databaseColumn{
255-
Realname: columnName,
255+
Realname: fmt.Sprintf(`"%s"`, columnName),
256256
SQLiteName: localColumnName,
257257
Type: columnType,
258258
Supported: typeSupported,

0 commit comments

Comments
 (0)