graphile-search-plugin
v0.1.2
Published
generate search conditions for your tsvector columns
Downloads
13
Maintainers
Readme
graphile-search-plugin
npm install graphile-search-plugin
This PostGraphile schema plugin was built to enable ordering via ts_rank
of full-text search on all tsvector
fields, providing auto-generated queries within PostGraphile.
Usage
- Append the new plugins!
- Query
search<YourTsvectorColumn>
in theconditions
field - Enjoy!
import PgSearchPlugin from 'graphile-search-plugin';
app.use(
postgraphile(connectionStr, schemas, {
appendPlugins: [
PgSearchPlugin
]
})
);
Examples
Look in the tests ;)
Testing
createdb test_database
psql test_database < sql/roles.sql
psql test_database < sql/test.sql
yarn test