Open
Description
Hi and thanks for the neat package. Any interest in adding support for Maps? They're nice to work with except for needing Array.from()
:
const fields = new Map()
fields.set('username', username.trim())
fields.set('password', await bcrypt.hash(newPassword, 12))
...
const query = sql`
INSERT INTO users ${sql.tuple(Array.from(fields.keys()).map(sql.column))}
VALUES ${sql.tuple(Array.from(fields.values()))}
`
I think sqlate could handle the array conversion, with a few extra checks to stay ES5-compatible. Happy to submit a PR if you think it's a good idea?
Metadata
Metadata
Assignees
Labels
No labels