{"id":15429554,"url":"https://github.com/gajus/slonik-interceptor-query-normalisation","last_synced_at":"2025-07-11T08:40:20.460Z","repository":{"id":57142520,"uuid":"172087059","full_name":"gajus/slonik-interceptor-query-normalisation","owner":"gajus","description":"Normalises Slonik queries.","archived":false,"fork":false,"pushed_at":"2020-02-13T07:41:38.000Z","size":15,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-21T13:44:09.625Z","etag":null,"topics":["postgresql","slonik"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-22T15:14:33.000Z","updated_at":"2024-09-11T17:43:03.000Z","dependencies_parsed_at":"2022-09-05T18:41:34.178Z","dependency_job_id":null,"html_url":"https://github.com/gajus/slonik-interceptor-query-normalisation","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/gajus/slonik-interceptor-query-normalisation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fslonik-interceptor-query-normalisation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fslonik-interceptor-query-normalisation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fslonik-interceptor-query-normalisation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fslonik-interceptor-query-normalisation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajus","download_url":"https://codeload.github.com/gajus/slonik-interceptor-query-normalisation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Fslonik-interceptor-query-normalisation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264767401,"owners_count":23660955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","slonik"],"created_at":"2024-10-01T18:11:27.976Z","updated_at":"2025-07-11T08:40:20.435Z","avatar_url":"https://github.com/gajus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slonik-interceptor-query-normalisation\n\n[![Travis build status](http://img.shields.io/travis/gajus/slonik-interceptor-query-normalisation/master.svg?style=flat-square)](https://travis-ci.org/gajus/slonik-interceptor-query-normalisation)\n[![Coveralls](https://img.shields.io/coveralls/gajus/slonik-interceptor-query-normalisation.svg?style=flat-square)](https://coveralls.io/github/gajus/slonik-interceptor-query-normalisation)\n[![NPM version](http://img.shields.io/npm/v/slonik-interceptor-query-normalisation.svg?style=flat-square)](https://www.npmjs.org/package/slonik-interceptor-query-normalisation)\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social\u0026label=Follow)](https://twitter.com/kuizinas)\n\nNormalises [Slonik](https://github.com/gajus/slonik) query.\n\n## API\n\n```js\nimport {\n  createQueryNormalisationInterceptor\n} from 'slonik';\n\n```\n\n```js\n/**\n * @property stripComments Strips comments from the query (default: true).\n */\ntype ConfigurationType = {|\n  +stripComments?: boolean\n|};\n\n(configuration?: ConfigurationType) =\u003e InterceptorType;\n\n```\n\n## Example usage\n\n```js\nimport {\n  createPool\n} from 'slonik';\nimport {\n  createQueryNormalisationInterceptor\n} from 'slonik-interceptor-query-normalisation';\n\nconst interceptors = [\n  createQueryNormalisationInterceptor({\n    stripComments: true\n  })\n];\n\nconst connection = createPool('postgres://', {\n  interceptors\n});\n\nconnection.any(sql`\n  -- Foo bar.\n  SELECT\n    id,\n    full_name\n  FROM person\n`);\n\n```\n\nEvalutes query:\n\n```sql\nSELECT id, full_name FROM person\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Fslonik-interceptor-query-normalisation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajus%2Fslonik-interceptor-query-normalisation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Fslonik-interceptor-query-normalisation/lists"}