Normalizes Slonik query.
npm install slonik-interceptor-query-normalisation




Normalises Slonik query.
``js
import {
createQueryNormalisationInterceptor
} from 'slonik';
`
`js
/**
* @property stripComments Strips comments from the query (default: true).
*/
type ConfigurationType = {|
+stripComments?: boolean
|};
(configuration?: ConfigurationType) => InterceptorType;
`
`js
import {
createPool
} from 'slonik';
import {
createQueryNormalisationInterceptor
} from 'slonik-interceptor-query-normalisation';
const interceptors = [
createQueryNormalisationInterceptor({
stripComments: true
})
];
const connection = createPool('postgres://', {
interceptors
});
connection.any(sql
-- Foo bar.
SELECT
id,
full_name
FROM person);
`
Evalutes query:
`sql
SELECT id, full_name FROM person
``