Skip to content

postgrelize / JsonTableOptions

Type Alias: JsonTableOptions ​

JsonTableOptions = Readonly<{ columns: readonly JsonTableColumnOptions[]; doc: unknown; path: string; }>

Defined in: src/model/source-options.ts:62

postgrelize extension

JSON_TABLE source: turns a JSON document into rows. PostgreSQL extension. Needs PostgreSQL 17.

Example ​

ts
const source: JsonTableOptions = {
  doc: { items: [{ sku: 'a', qty: 2 }] },
  path: '$.items[*]',
  columns: [{ name: 'sku', type: 'text' }, { name: 'qty', type: 'integer' }],
};

Released under the MIT License.