Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sql2json

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql2json - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

3

CHANGELOG.md

@@ -0,1 +1,4 @@

# 2.0.2
- Table names not surrounded by quotes now support slashes in them
# 2.0.1

@@ -2,0 +5,0 @@ - JSON2SQL - Revert changes to query output format, matching it to ES SQL instead of PostrgreSQL spec

@@ -299,2 +299,3 @@ const lexer = require('sql-parser').lexer;

case 'MATH':
case 'MATH_MULTI':
name += token[1];

@@ -301,0 +302,0 @@ break;

2

package.json
{
"name": "sql2json",
"version": "2.0.1",
"version": "2.0.2",
"description": "PostgreSQL to/from JSON conversion lib",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -64,2 +64,16 @@ const assert = require('assert');

it('With table name with slash without quotes', () => {
const data = {
select: [{
value: '*',
alias: null,
type: 'wildcard'
}],
from: 'ft:table/name'
};
const response = 'SELECT * FROM ft:table/name';
Json2sql.toSQL(data).should.deepEqual(response);
});
it('With table name inside dots', () => {

@@ -66,0 +80,0 @@ const data = {

@@ -7,3 +7,3 @@ const assert = require('assert');

describe('SQL to JSON - Complex queries', () => {
it('All', () => {
it('Complex query 1', () => {
const response = {

@@ -10,0 +10,0 @@ select: [{

@@ -68,2 +68,17 @@ const assert = require('assert');

it('With table name with slash without quotes', () => {
const response = {
select: [{
value: '*',
alias: null,
type: 'wildcard'
}],
from: 'ft:table/name'
};
const obj = new Sql2json('select * from ft:table/name');
const json = obj.toJSON();
json.should.deepEqual(response);
});
it('With table name inside dots', () => {

@@ -70,0 +85,0 @@ const response = {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc