Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pgsql_ast_parser/mod.ts

Yet another simple Postgres SQL parser
Latest
import * as pgsqlAstParser from "https://deno.land/x/pgsql_ast_parser@12.0.1/mod.ts";

Functions

An helper function that returns a map of an array, but:

  • It will return the original array if it is null-ish
  • It will remove all null-ish entries
  • It will return the original array if nothing has changed

An helper function that returns a copy of an object with modified properties (similar to Object.assign()), but ONLY if thos properties have changed. Will return the original object if not.

Builds an AST modifier based on the default implementation, merged with the one you provide.

Builds an AST visitor based on the default implementation, merged with the one you provide.

Interval value to postgres string representation

Returns a normalized copy of the given interval

Parse an AST from SQL

Parse the first SQL statement in the given text (discards the rest), and return its AST

Parse an AST from SQL, and get the comments

Interfaces

Function calls.

Handle special syntax: overlay('12345678' placing 'ab' from 2 for 4)

Handle special syntax: substring('val' from 2 for 3)

Line aX+bY+c