@spacefill/postgraphile-plugin-unaccented-text-search-filter
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Package on npm

postgraphile-plugin-unaccented-text-search-filter

Adds unaccent string filtering capabilities to a PostGraphile schema.

This plugin extends the postgraphile-plugin-connection-filter plugin with unaccentuated text filter operators.

This plugin supports filtering on all PostgreSQL string types: char, varchar, text.

Plugin Options

When using PostGraphile as a library, many options can be passed via graphileBuildOptions. See here for more information.

Examples

query {
  allPosts(filter: {
    body: { includesUnaccentInsensitive: "Solidarité" }
  }) {
    ...
  }
}

For an extensive set of examples, see docs/examples.md.

Development

To establish a test environment, create an empty PostgreSQL database with C collation (required for consistent ordering of strings) and set a TEST_DATABASE_URL environment variable with your database connection string.

createdb graphile_test_c --template template0 --lc-collate C
export TEST_DATABASE_URL=postgres://localhost:5432/graphile_test_c
yarn
yarn test

You can also use a language specific ICU collation by changing C to the wanted collation, e.g. "fr-x-icu" for French collation.

Package Sidebar

Install

npm i @spacefill/postgraphile-plugin-unaccented-text-search-filter

Weekly Downloads

17

Version

0.0.1

License

MIT

Unpacked Size

9.05 kB

Total Files

6

Last publish

Collaborators

  • itsalex