db-json-column
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

db-json-column image test

If you need to query JSON columns with your Query Builder and Connection Pool without writing raw SQL, this package is for you.

Knex example

await updateJson(knex, knex(tableName).where('id', 1), ['data.foo'], { data: { foo: 'bar' } })

// { data: { foo: 'bar' } }
await selectAndParseJson(knex, knex(tableName), ['data.foo'])

TypeORM example

await updateJson(
  repository.createQueryBuilder().update().where({ id: 1 }),
  ['data.foo'],
  { data: { foo: 'bar' } },
)

// { data: { foo: 'bar' } }
await selectAndParseJson(repository.createQueryBuilder(), ['data.foo'])

Table of contents

Readme

Keywords

none

Package Sidebar

Install

npm i db-json-column

Weekly Downloads

169

Version

0.0.3

License

Apache-2.0

Unpacked Size

112 kB

Total Files

50

Last publish

Collaborators

  • wholenewsorg
  • jmfoutts