-
Notifications
You must be signed in to change notification settings - Fork 0
JSON Columns
Christoph Herrmann edited this page Nov 21, 2019
·
1 revision
const columns = [
'id',
sql.jsonColumnObject(['data', 'keyA', 'keyB']),
sql.jsonColumnText(['data', 'keyA', 'keyB'])
]
const result = await sql.query(sql`
SELECT ${sql.columns(columns)} FROM "users"
`)
// text: SELECT "id", "data"->'keyA'->'keyB', "data"->'keyA'->>'keyB' FROM "users"
// values: []
Found a bug or missing a feature? -> Create a new Issue
Found a security issue? -> Look at the Security Policy
Having questions, want to give feedback or talk to me? -> E-Mail me [email protected]