Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

The issue requested limiting the impact of the PATH keyword so it can be used as table/column names while remaining a keyword for graph search operations.

Investigation Results

PATH is already in the NonReserved list (line 3171 in alasqlparser.jison), which allows it to function as an identifier through the Literal rule's error recovery mechanism. This is the standard LR parser pattern for non-reserved keywords.

Changes

  • Added comprehensive test suite (test/test2222.js) covering:
    • PATH as table name, column name, and alias
    • PATH in WHERE, ORDER BY, GROUP BY, JOIN operations
    • PATH in graph SEARCH queries (original keyword usage)

Example Usage

// All of these work without issues:
alasql('CREATE TABLE path (id INT, name STRING)');
alasql('SELECT path FROM data WHERE path = "/home"');
alasql('SELECT * FROM files ORDER BY path');

// PATH still works as keyword in graph queries:
alasql('SEARCH PATH(#Josephine) name FROM #Napoleon');

Conclusion

No grammar changes needed. The current implementation is optimal - PATH functions as a keyword in SearchSelector context while being usable as an identifier elsewhere. All 2109 tests pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>Limit the impact of using the keyword: PATH</issue_title>
<issue_description>Limit the impact of using the keyword: PATH

Just like in #2203 we want to limit the impact of having keywords. Preferably by making them keywords only in the context needed so the string/word can be used for things like table names and column names i the data - if possible. It might be too much of a hassle to make the impact less, but lets investigate what is possible - still sticking to the SQL-99 specs.

Start by making a test file named test0000.js where 0000 is the issue ID of this ticket. Replicate the use and mimic what usecases could make sense to test, like as a table name, as a column name, as a graph search. Things lke that.

The grammar can be updated in alasqlgrammar.jison. Focus on small precise changes. After updating it we need to run yarn jison && yarn test

Always run yarn format before committing.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Copilot AI changed the title [WIP] Update grammar to limit the impact of keyword PATH Verify PATH keyword already works as identifier via NonReserved list Dec 16, 2025
Copilot AI requested a review from mathiasrw December 16, 2025 23:01
Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Copilot AI requested a review from mathiasrw December 17, 2025 13:57
@mathiasrw mathiasrw marked this pull request as ready for review December 21, 2025 04:54
@mathiasrw mathiasrw merged commit 4c77bec into develop Dec 21, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit the impact of using the keyword: PATH

2 participants