oracle / pgql-lang

PGQL is an SQL-based query language for property graphs
https://pgql-lang.org/
Other
182 stars 44 forks source link

Expose unique names for variables #134

Closed oskar-van-rest closed 7 months ago

oskar-van-rest commented 7 months ago

Two variables may have the same name. For example when they appear in different subqueries or different clauses.

This PR adds a getUniqueName() to each variable that allows for distinguishing the variables names from one another.

The unique name is based on the offset of the variable in the original query text (e.g. in case of SELECT 123 AS var FROM ..., variable var will have unique name var_(14, 17) since character v has (0-based) index 14 and the space after r has index 17.