You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mysql-query-validator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-query-validator

This is just a simple wrapper over [this Golang executable](https://github.com/xwb1989/sqlparser) to validate SQL queries.

0.0.4
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

mysql-query-validator

This is just a simple wrapper over this Golang executable to validate SQL queries.

Installation

yarn add mysql-query-validator

Example

import { validate } from 'mysql-query-validator'

try {
  validate(`
    create table test (
      id varchar(20) not null,
      created_at datetime(6),
      slug varbinary(255),
      enabled tinyint(1),
      labels json // missing comma
      url blob
    )
  `)
} catch (err) {
  console.error(err.message) // syntax error at position N near 'url'
}

Keywords

typescript

FAQs

Package last updated on 19 Dec 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