Comparing version 2.0.1 to 2.0.2
@@ -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; |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
207111
4937