0.0.3 • Published 2 years ago

soql-escape v0.0.3

Weekly downloads
130
License
MIT
Repository
github
Last release
2 years ago

soql-escape

Escape soql queries

Installation

npm i soql-escape

or with yarn

yarn add soql-escape

Usage

const { soql } = require('soql-escape')

Query with characters to escape:

soql`SELECT foo FROM Bar WHERE str = ${unEscapedString}`

Query using a date:

soql`
    SELECT id, CreatedDate
    FROM Sales_Order__c
    WHERE CreatedDate < ${new Date('2013-05-21T00:00:00Z')}
`

It is also possible to import the escape function directly:

const { escape } = require('soql-escape')

assert(escape('"quotes\'') === `'\\"quotes\\''`)

Contributing

Fork this repo and create a pull-request.

0.0.3

2 years ago

0.0.2

6 years ago

0.0.1

6 years ago