Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

sql-adaptor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-adaptor

This is a repository that packages and exposes sql functions necessary as a standalone library

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

sql-adaptor-js

This is a repository that packages and exposes SQL functions necessary as a platform library

All basic SQL functions are exposed in lib/index.js

Testing

  • Start a SQL instance. ./startSQL.sh
  • Copy config-example.yaml to config-local.yaml
  • Run tests! npm test

Escaping

We've added a friendly escaping system! It can be used like so:

SQL.query(`
  INSERT INTO items (type, count)
  VALUES ($0, $1);
`, ['drug', 15])

This will insert { type: 'drug', count: 15 }.

Be sure to escape all values which may change in queries using this method! :)

Troubleshooting

To create a table the library accepts a JSON object with the key as the name of the field and the value as all other options that SQL accepts such as type, KEY, auto-increment etc. If there are multiple options it must be formatted correctly with spaces in between them and be in a single string.

To use this library you will need permissions to use Chronicled private npm registry. Once you have the credentials/token,

  • npm install @chronicled/sql-adaptor-js
  • require('@chronicled/sql-adaptor-js') in your application

FAQs

Package last updated on 03 Jul 2019

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