Skip to content

Conversation

Copy link

Copilot AI commented Jan 2, 2026

The CLOSE keyword was fully reserved, preventing its use as table/column names. This follows the pattern established in AlaSQL#2203 for the KEY keyword.

Changes

Grammar (alasqlparser.jison):

  • Added CLOSE to Literal production rule enabling identifier usage
  • Added CLOSE to NonReserved list and array (alphabetically after CLASS_ORIGIN)

Tests (test/test2248.js):

  • 12 test cases covering table names, column names, aliases, WHERE/JOIN/GROUP BY/ORDER BY clauses, and UPDATE/DELETE operations

Example

// Previously failed, now works
alasql('CREATE TABLE close (id INT, close VARCHAR(50))');
alasql("INSERT INTO close VALUES (1, 'value')");
alasql('SELECT close FROM close WHERE close = "value"');

// With quoted identifiers
alasql('CREATE TABLE [close] (id INT, name VARCHAR(50))');

CLOSE CURSOR syntax remains available for future cursor implementations (currently commented out in grammar).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • upload.wikimedia.org
    • Triggering command: /usr/local/bin/node /usr/local/bin/node node_modules/mocha/bin/mocha.js ./test --reporter dot --bail test/test2248.js ACCEPT (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node node_modules/mocha/bin/mocha.js ./test --reporter dot --bail (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement issue 2248</issue_title>
<issue_description>implement this issue: AlaSQL#2248

Limit the impact of using the keyword: CLOSE

Just like in AlaSQL#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)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ests

Co-authored-by: ericmort <7136207+ericmort@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement issue 2248 to limit CLOSE keyword impact Make CLOSE usable as identifier while preserving keyword semantics Jan 2, 2026
Copilot AI requested a review from ericmort January 2, 2026 22:51
@ericmort ericmort marked this pull request as ready for review January 3, 2026 07:58
@ericmort ericmort merged commit c968130 into develop Jan 3, 2026
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.

Implement issue 2248

2 participants