postgres-array

Parse postgres array columns

MIT 10 个版本
安装
npm install postgres-array
yarn add postgres-array
pnpm add postgres-array
bun add postgres-array
README

postgres-array tests

Parse postgres array columns

Install

npm install --save postgres-array

Usage

const { parse } = require('postgres-array')

parse('{1,2,3}', (value) => parseInt(value, 10))
//=> [1, 2, 3]

API

parse(input, [transform]) -> array

input

Required
Type: string

A Postgres array string.

transform

Type: function
Default: identity

A function that transforms non-null values inserted into the array.

License

MIT © Ben Drucker

版本列表
3.0.4 2025-03-06
3.0.3 2025-03-05
3.0.2 2023-02-08
3.0.1 2020-10-29
3.0.0 2020-10-29
2.0.0 2018-10-22
1.0.3 2018-09-17
1.0.2 2016-12-09
1.0.1 2016-12-09
1.0.0 2015-06-12