pgsql-ast-parser
Advanced tools
Comparing version 4.0.0 to 4.0.1
{ | ||
"name": "pgsql-ast-parser", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Yet another simple Postgres SQL parser/modifier", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -747,2 +747,8 @@ import * as a from './syntax/ast'; | ||
return this.fromValues(from); | ||
case 'call': | ||
const call = this.call(from); | ||
if (!call || call.type !== 'call') { | ||
return null; | ||
} | ||
return call; | ||
default: | ||
@@ -749,0 +755,0 @@ throw NotSupported.never(from); |
@@ -410,5 +410,6 @@ // import { IType } from '../../interfaces'; | ||
export type From = FromTable | FromStatement | FromValues; | ||
export type From = FromTable | FromStatement | FromValues | ExprCall; | ||
export interface FromValues { | ||
@@ -415,0 +416,0 @@ type: 'values'; |
@@ -28,3 +28,3 @@ import 'mocha'; | ||
function aliased(alias: string): SelectStatement { | ||
return { | ||
return { | ||
type: 'select', | ||
@@ -74,3 +74,3 @@ columns: [{ | ||
type: 'select', | ||
from: [{ type: 'table', name: 'current_schema' }], | ||
from: [{ type: 'call', function: { type: 'keyword', keyword: 'current_schema' }, args: [] }], | ||
columns: noAlias([{ type: 'ref', name: '*' }]) | ||
@@ -407,2 +407,16 @@ }); | ||
}) | ||
checkSelect([`select * from concat('a', 'b')`], { | ||
type: 'select', | ||
from: [{ | ||
type: 'call', | ||
function: 'concat', | ||
args: [ | ||
{ type: 'string', value: 'a' }, | ||
{ type: 'string', value: 'b' }, | ||
] | ||
}], | ||
columns: noAlias([{ type: 'ref', name: '*' }]), | ||
}) | ||
}); |
@@ -298,3 +298,3 @@ import { nil } from '../utils'; | ||
} | ||
export declare type From = FromTable | FromStatement | FromValues; | ||
export declare type From = FromTable | FromStatement | FromValues | ExprCall; | ||
export interface FromValues { | ||
@@ -301,0 +301,0 @@ type: 'values'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
986311
10847