Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

Issue #2239 requested investigating whether the CONTENT keyword's impact could be limited to allow usage as table/column names while preserving its role in CREATE VERTEX/EDGE operations.

Investigation Findings

CONTENT already functions as a context-sensitive keyword through Jison's NonReserved mechanism:

  • Declared as token (line 99) for CREATE VERTEX/EDGE syntax
  • Listed in NonReserved rule (line 3171) enabling identifier usage
  • parseError function (lines 3180-3185) resolves conflicts by treating NonReserved keywords as LITERALs

This allows:

-- Works as table name
CREATE TABLE content (id INT, name STRING);

-- Works as column name  
CREATE TABLE data (id INT, content STRING);

-- Works as both simultaneously
CREATE TABLE content (id INT, content STRING);
SELECT content.content FROM content;

-- Still functions as keyword in graph operations
CREATE VERTEX Person CONTENT {name:"Alice", age:25};

Changes

  • test/test2239.js: Added 10 test cases covering all usage scenarios (table names, column names, JOINs, GROUP BY, subqueries, graph operations)

No grammar modifications required. Current implementation is optimal.

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:

  • https://api.github.com/repos/AlaSQL/alasql/pulls/2203
    • Triggering command: /usr/bin/curl curl -s REDACTED (http 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>Limit the impact of using the keyword: CONTENT</issue_title>
<issue_description>Limit the impact of using the keyword: CONTENT

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.

Investigation shows CONTENT keyword already works optimally:
- Can be used as table name
- Can be used as column name
- Still functions as keyword in CREATE VERTEX/EDGE contexts
- Already in NonReserved list for identifier usage
- parseError function handles conflicts properly

All 10 tests passing without grammar changes needed.

Co-authored-by: mathiasrw <1063454+mathiasrw@users.noreply.github.com>
Copilot AI changed the title [WIP] Limit the impact of using the keyword CONTENT Document CONTENT keyword behavior with comprehensive test coverage Dec 16, 2025
Copilot AI requested a review from mathiasrw December 16, 2025 22:56
@mathiasrw mathiasrw marked this pull request as ready for review December 17, 2025 12:57
@mathiasrw mathiasrw merged commit 95bbff8 into develop Dec 17, 2025
10 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: CONTENT

2 participants