paupino / psqlpack

A logical database management system for PostgreSQL enabling incremental database deployment.
Apache License 2.0
8 stars 2 forks source link

Change Lexer so that it supports different modes #127

Closed paupino closed 4 years ago

paupino commented 5 years ago

For example, "index" is a valid identifier name within appropriate context however is also a first class keyword (INDEX) in other contexts.

paupino commented 5 years ago

An example of valid syntax is:

CREATE OR REPLACE FUNCTION index(index int) 
RETURNS int
AS $body$
SELECT index
$body$
LANGUAGE SQL;
SELECT index(5);
paupino commented 5 years ago

It's likely that I'll need to break out some tokens from others. For example what is not valid as a table name (for example):

What is valid: