1.1.10 • Published 4 years ago

slonik-interceptor-query-normalisation v1.1.10

Weekly downloads
694
License
BSD-3-Clause
Repository
github
Last release
4 years ago

slonik-interceptor-query-normalisation

Travis build status Coveralls NPM version Canonical Code Style Twitter Follow

Normalises Slonik query.

API

import {
  createQueryNormalisationInterceptor
} from 'slonik';
/**
 * @property stripComments Strips comments from the query (default: true).
 */
type ConfigurationType = {|
  +stripComments?: boolean
|};

(configuration?: ConfigurationType) => InterceptorType;

Example usage

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:

SELECT id, full_name FROM person
1.1.10

4 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago