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 8.1.0 to 8.1.1

2

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

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

@@ -394,2 +394,5 @@ // import { IType } from '../../interfaces';

name: QName;
temporary?: boolean;
unlogged?: boolean;
locality?: 'global' | 'local';
ifNotExists?: true;

@@ -396,0 +399,0 @@ columns: (CreateColumnDef | CreateColumnsLikeTable)[];

@@ -42,2 +42,76 @@ import 'mocha';

checkInvalid('create temp unlogged table test (id text)');
checkInvalid('create global unlogged table test (id text)');
checkCreateTable(['create temp table test(value text)', 'create temporary table test(value text)'], {
type: 'create table',
name: { name: 'test', },
temporary: true,
columns: [{
kind: 'column',
name: { name: 'value' },
dataType: {
name: 'text',
},
}],
});
checkCreateTable(['create unlogged table test(value text)'], {
type: 'create table',
name: { name: 'test', },
unlogged: true,
columns: [{
kind: 'column',
name: { name: 'value' },
dataType: {
name: 'text',
},
}],
});
checkCreateTable(['create global table test(value text)', 'create GLOBAL table test(value text)'], {
type: 'create table',
name: { name: 'test', },
locality: 'global',
columns: [{
kind: 'column',
name: { name: 'value' },
dataType: {
name: 'text',
},
}],
});
checkCreateTable(['create local table test(value text)'], {
type: 'create table',
name: { name: 'test', },
locality: 'local',
columns: [{
kind: 'column',
name: { name: 'value' },
dataType: {
name: 'text',
},
}],
});
checkCreateTable(['create local temp table test(value text)'], {
type: 'create table',
name: { name: 'test', },
locality: 'local',
temporary: true,
columns: [{
kind: 'column',
name: { name: 'value' },
dataType: {
name: 'text',
},
}],
});
checkCreateTable(`CREATE TABLE capitals (

@@ -44,0 +118,0 @@ state char(2)

@@ -817,3 +817,13 @@ import { IAstPartialMapper, AstDefaultMapper } from './ast-mapper';

createTable: t => {
ret.push(t.ifNotExists ? 'CREATE TABLE IF NOT EXISTS ' : 'CREATE TABLE ');
ret.push('CREATE ');
if(t.locality) {
ret.push(t.locality.toUpperCase(), ' ');
}
if (t.temporary) {
ret.push('TEMPORARY ');
}
if(t.unlogged) {
ret.push('UNLOGGED ');
}
ret.push(t.ifNotExists ? 'TABLE IF NOT EXISTS ' : 'TABLE ');
m.tableRef(t.name);

@@ -820,0 +830,0 @@ ret.push('(');

@@ -285,2 +285,5 @@ import { nil } from '../utils';

name: QName;
temporary?: boolean;
unlogged?: boolean;
locality?: 'global' | 'local';
ifNotExists?: true;

@@ -287,0 +290,0 @@ columns: (CreateColumnDef | CreateColumnsLikeTable)[];

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

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