@electric-sql/pglite-icu-full
v0.0.2
Published
ICU support
Readme
pglite-icu-full
A package containing all the data resources from libicu that can be used with PGlite to build localized applications.
Installation
npm install @electric-sql/pglite-icu-full
# or
yarn add @electric-sql/pglite-icu-full
# or
pnpm add @electric-sql/pglite-icu-fullUsage
This loads the entire locale set provided by libicu, which might be quite large.
import { PGlite } from '@electric-sql/pglite'
import { icuDataDir } from '@electric-sql/pglite-icu-full'
// Create a PGlite instance with the icu resources
const pg = await PGlite.create({
icuDataDir: await icuDataDir(),
})
// just an example, query the available collations
const collations = await pg.exec('select * from pg_collation')
To generate a new locale set, see packages/pglite-icu-full/examples/README.md as well as libicu's documentation (https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html).
Documentation
https://www.postgresql.org/docs/current/locale.html https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html
