Socket
Book a DemoInstallSign in
Socket

slonik-interceptor-query-normalisation

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slonik-interceptor-query-normalisation

Normalizes Slonik query.

latest
Source
npmnpm
Version
1.1.10
Version published
Maintainers
1
Created
Source

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

Keywords

postgresql

FAQs

Package last updated on 13 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts