Socket
Book a DemoInstallSign in
Socket

ocpgescape

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ocpgescape

escape postgres queries which do not support stored procedures

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

ocpgescape

Sprintf-style postgres query formatting and escape helper functions.

Forked from pg-escape

API

escape(fmt, ...)

Format the given arguments using a format string

escape.string(val)

Emit verbatim

escape.dollar_string(val)

Format as a dollar quoted string

escape.quote_string(val)

Format as a SQL string.

escape.ident(val)

Format as an identifier.

escape.literal(val)

Format as a literal.

Formats

  • %s formats the argument value as a simple string.
  • %Q formats the argument value as a dollar quoted string. A null value is treated as an empty string.
  • %I treats the argument value as an SQL identifier, double-quoting it if necessary. It is an error for the value to be null.
  • %L stringifies JSON objects, SQL-quotes small strings, dollar-quotes long strings, and emits NULLs, numbers, and booleans unquoted.
  • %J stringifies the value then emits as either a SQL-string or a dollar-quoted string, depending on the length of the resulting JSON.
  • %% In addition to the format specifiers described above, the special sequence %% may be used to output a literal % character.

License

MIT

Keywords

pg

FAQs

Package last updated on 20 Jul 2017

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