New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pgsql-ast-parser

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pgsql-ast-parser - npm Package Compare versions

Comparing version 4.1.2 to 4.1.3

2

ast-mapper.d.ts

@@ -44,2 +44,3 @@ import * as a from './syntax/ast';

from?: (from: a.From) => a.From | nil;
fromCall?: (from: a.FromCall) => a.From | nil;
fromStatement?: (from: a.FromStatement) => a.From | nil;

@@ -165,2 +166,3 @@ fromValues?: (from: a.FromValues) => a.From | nil;

from(from: a.From): a.From | nil;
fromCall(from: a.FromCall): a.From | nil;
fromStatement(from: a.FromStatement): a.From | nil;

@@ -167,0 +169,0 @@ fromValues(from: a.FromValues): a.From | nil;

2

package.json
{
"name": "pgsql-ast-parser",
"version": "4.1.2",
"version": "4.1.3",
"description": "Yet another simple Postgres SQL parser/modifier",

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

@@ -47,2 +47,3 @@ import * as a from './syntax/ast';

from?: (from: a.From) => a.From | nil
fromCall?: (from: a.FromCall) => a.From | nil
fromStatement?: (from: a.FromStatement) => a.From | nil

@@ -785,7 +786,3 @@ fromValues?: (from: a.FromValues) => a.From | nil;

case 'call':
const call = this.call(from);
if (!call || call.type !== 'call') {
return null;
}
return call;
return this.fromCall(from);
default:

@@ -796,2 +793,11 @@ throw NotSupported.never(from);

fromCall(from: a.FromCall): a.From | nil {
const call = this.call(from);
if (!call || call.type !== 'call') {
return null;
}
return assignChanged(from, call);
}
fromStatement(from: a.FromStatement): a.From | nil {

@@ -913,3 +919,3 @@ const statement = this.select(from.statement);

parameter (st: a.ExprParameter): a.Expr | nil {
parameter(st: a.ExprParameter): a.Expr | nil {
return st;

@@ -916,0 +922,0 @@ }

@@ -267,3 +267,3 @@ // import { IType } from '../../interfaces';

query: SelectStatement;
parameters?: {[name: string]: string};
parameters?: { [name: string]: string };
}

@@ -433,6 +433,12 @@ export interface CreateViewStatement extends CreateViewStatementBase {

export type From = FromTable | FromStatement | FromValues | ExprCall & { alias?: string; };
export type From = FromTable | FromStatement | FromValues | FromCall
export interface FromCall extends ExprCall {
alias?: string;
join?: JoinClause | nil;
};
export interface FromValues {

@@ -439,0 +445,0 @@ type: 'values';

@@ -417,3 +417,39 @@ import 'mocha';

checkSelect([`select * from concat('a') as a join concat('b') as b on b=a`], {
type: 'select',
from: [{
type: 'call',
function: 'concat',
alias: 'a',
args: [
{ type: 'string', value: 'a' },
]
}, {
type: 'call',
function: 'concat',
args: [
{ type: 'string', value: 'b' },
],
alias: 'b',
join: {
type: 'INNER JOIN',
on: {
type: 'binary',
op: '=',
left: {
type: 'ref',
name: 'b',
},
right: {
type: 'ref',
name: 'a',
},
}
},
}],
columns: columns({ type: 'ref', name: '*' }),
})
checkSelect([`select * from concat('a', 'b') as tbl`], {

@@ -420,0 +456,0 @@ type: 'select',

@@ -631,8 +631,14 @@ import { IAstPartialMapper, AstDefaultMapper } from './ast-mapper';

from: t => {
const f = m.super().from(t);
if (t.alias && t.type === 'call') {
ret.push(' AS ', name(t.alias), ' ');
}
return f;
from: t => m.super().from(t),
fromCall: s => {
join(m, s.join, () => {
m.call(s);
if (s.alias) {
ret.push(' AS ', name(s.alias), ' ');
}
});
ret.push(' ');
},

@@ -639,0 +645,0 @@

@@ -316,5 +316,7 @@ import { nil } from '../utils';

}
export declare type From = FromTable | FromStatement | FromValues | ExprCall & {
export declare type From = FromTable | FromStatement | FromValues | FromCall;
export interface FromCall extends ExprCall {
alias?: string;
};
join?: JoinClause | nil;
}
export interface FromValues {

@@ -321,0 +323,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

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