Closed
Description
Transforming column names in both ways would greatly improved ergonomics of the library. Consider this example:
const sql = postgres({
transform: {
column: postgres.toCamel,
},
})
const entity = {
appliedAt: new Date, // db column name is "applied_at"
}
// error: column "appliedat" of relation "some_table" does not exist
sql`INSERT INTO some_table ${sql(entity)}`
Transform option should work both ways, I think. May be configured like this:
{
transform: {
column: {
fromDb: postgres.toCamel,
toDb: postgres.toSnake,
},
},
}