Skip to content

Add CQL (Cassandra Query Language) as its own language#7720

Merged
lildude merged 12 commits intogithub-linguist:mainfrom
Akzestia:main
Jan 12, 2026
Merged

Add CQL (Cassandra Query Language) as its own language#7720
lildude merged 12 commits intogithub-linguist:mainfrom
Akzestia:main

Conversation

@Akzestia
Copy link
Copy Markdown
Contributor

Introduced separate grammar for CQL.

  • I am adding a new language.
    • The extension of the new language is used in hundreds of repositories on GitHub.com.
    • I have included a real-world usage sample for all extensions added in this PR:
    • I have included a syntax highlighting grammar: cqlTextMate (Also see examples below SQL vs CQL)
    • I have added a color
      • Hex value: #006091
      • Based on Apache Cassandra color scheme(Open to any suggestions regarding more fitting color).

Example highlights:

Screenshots are from VS Code with TextMate languages extension

ALTER MATERIALIZED VIEW cycling.cyclist_by_age
WITH comment = 'A most excellent and useful view'
AND bloom_filter_fp_chance = 0.02;

ALTER MATERIALIZED VIEW cycling.cyclist_by_age
WITH compression = {
    'sstable_compression' : 'DeflateCompressor',
    'chunk_length_kb' : 64
}
AND compaction = {
    'class' : 'SizeTieredCompactionStrategy',
    'max_threshold' : 64
};

ALTER MATERIALIZED VIEW cycling.cyclist_by_age
WITH caching = {
    'keys' : 'NONE',
    'rows_per_partition' : '15'
};
{A74DDF5D-BB17-48D5-9C84-CD3AD7723F6B}
ALTER ROLE sandy WITH PASSWORD = 'bestTeam';

ALTER ROLE sandy WITH SUPERUSER=true;

ALTER ROLE team_manager WITH LOGIN=true;
{3B8D2DCF-DE3B-4C6E-BFCB-646BEE91F23A}
ALTER TABLE cycling.cyclist_races
ADD manager UUID;

ALTER TABLE cycling.cyclist_races
ADD completed list<text>;

ALTER TABLE cycling.cyclist_races;

DROP manager;

ALTER TABLE cycling.race_times RENAME race_date TO date;

ALTER TABLE food_cql_conversion.person WITH VERTEX LABEL "person";

ALTER TABLE food_cql_conversion.person_authored_book
WITH EDGE LABEL "authored"
FROM person(person_name, person_id)
TO book(book_name, book_id);

ALTER TABLE food.person RENAME VERTEX LABEL TO "personX";

ALTER TABLE food."person_authored_book" RENAME EDGE LABEL TO "authoredX";

ALTER TABLE food.person WITHOUT VERTEX LABEL "personX";

ALTER TABLE food."person_authored_book" WITHOUT EDGE LABEL "authoredX";

ALTER TABLE cycling.cyclist_base
WITH comment = 'basic cyclist information';

ALTER TABLE cycling.comments WITH caching = {
    'keys' : 'NONE',
    'rows_per_partition' : 10
};

ALTER TABLE cycling.cyclist_base
WITH speculative_retry = '95percentile';

ALTER TABLE cycling.cyclist_base
WITH speculative_retry = '10ms';

ALTER TABLE cycling.comments WITH COMPACTION = {
    'class' : 'SizeTieredCompactionStrategy',
    'enabled' : 'false'
};
{A62F230D-811B-4A40-8629-F08FE56F1478}
ALTER TYPE cycling.fullname
ADD middlename text;

ALTER TYPE cycling.fullname
RENAME middlename TO middle
AND lastname TO last
AND firstname TO first;
{3AEBAC40-BC24-4EA4-85C2-353AAC5FAFF2}
// @xx
-- @xx
/*
    This is the first line of
    of a comment that spans multiple
    lines
*/
CREATE ROLE IF NOT EXISTS coach -- End of line comment
WITH LOGIN = true
AND PASSWORD = 'All4One2day!';

CREATE ROLE IF NOT EXISTS sys_admin // End of line comment
WITH LOGIN = true
AND PASSWORD = 'changeme'
AND SUPERUSER = true;

/* @name some block */
{6AD4CB6B-56A6-4468-A634-560AAF568680}
CREATE KEYSPACE IF NOT EXISTS cycling
WITH REPLICATION = {
    'class' : 'SimpleStrategy',
    'replication_factor' : 1
};

CREATE KEYSPACE food_cql
WITH REPLICATION = {
    'class': 'SimpleStrategy',
    'replication_factor': 1
}
AND graph_engine = 'Core';

CREATE KEYSPACE cycling
WITH REPLICATION = {
    'class' : 'NetworkTopologyStrategy',
    'dc1' : 1
};

CREATE KEYSPACE IF NOT EXISTS cycling
WITH REPLICATION = {
    'class' : 'NetworkTopologyStrategy',
    'datacenter1': '3',
    'datacenter2': '3'
};

CREATE KEYSPACE cycling
WITH REPLICATION = {
    'class' : 'NetworkTopologyStrategy',
    'datacenter1' : 3
}
AND DURABLE_WRITES = false;
{F56EBC0D-6BEA-4C97-BC89-9D4583C4FF4A}
CREATE KEYSPACE videod
WITH REPLICATION = {
    'class' : 'SimpleStrategy',
    'replication_factor' : 1
};

use videodb;

// Basic entity table
// Object mapping ?
CREATE TABLE users (
    username                  varchar,
    firstname                 varchar,
    lastname                  varchar,
    email                     varchar,
    password                  varchar,
    created_date              timestamp,
    total_credits             int,
    credit_change_date        timeuuid,

    PRIMARY KEY (username)
);

// One-to-many entity table
CREATE TABLE videos (
    videoid            uuid,
    videoname          varchar,
    username           varchar,
    description        varchar,
    tags               list<varchar>,
    upload_date        timestamp,

    PRIMARY KEY (videoid)
);

// One-to-many from the user point of view
// Also know as a lookup table
CREATE TABLE username_video_index (
    username           varchar,
    videoid            uuid,
    upload_date        timestamp,
    videoname          varchar,

    PRIMARY KEY (username, videoid)
);

// Counter table
CREATE TABLE video_rating (
    videoid               uuid,
    rating_counter        counter,
    rating_total          counter,

    PRIMARY KEY (videoid)
);

// Creating index tables for tab keywords
CREATE TABLE tag_index (
    tag            varchar,
    videoid        uuid,
    timestamp      timestamp,

    PRIMARY KEY (tag, videoid)
);

// Comments as a many-to-many
// Looking from the video side to many users
CREATE TABLE comments_by_video (
    videoid           uuid,
    username          varchar,
    comment_ts        timestamp,
    comment           varchar,

    PRIMARY KEY (videoid, comment_ts, username)
) WITH CLUSTERING ORDER BY (comment_ts DESC, username ASC);

// looking from the user side to many videos
CREATE TABLE comments_by_user (
    username          varchar,
    videoid           uuid,
    comment_ts        timestamp,
    comment           varchar,

    PRIMARY KEY (username, comment_ts, videoid)
) WITH CLUSTERING ORDER BY (comment_ts DESC, videoid ASC);

// Time series wide row with reverse comparator
CREATE TABLE video_event (
    videoid                uuid,
    username               varchar,
    event                  varchar,
    event_timestamp        timeuuid,
    video_timestamp        bigint,

    PRIMARY KEY ((videoid, username), event_timestamp, event)
) WITH CLUSTERING ORDER BY (event_timestamp DESC, event ASC);
{8229944C-E2D1-4EFC-92FD-FCF032E4BDF2} {87A2AD10-FA68-4F70-B00C-9E36AC22FEDA}

@Akzestia Akzestia requested a review from a team as a code owner December 27, 2025 19:03
@Akzestia Akzestia changed the title Add Support for CQL Add Separate Grammar for CQL (Cassandra Query Language) Dec 27, 2025
@lildude lildude changed the title Add Separate Grammar for CQL (Cassandra Query Language) Add CQL (Cassandra Query Language) as its own language Jan 8, 2026
@lildude
Copy link
Copy Markdown
Member

lildude commented Jan 8, 2026

The ArkTS grammar issue is being addressed by the revert in #7737.

The license cache issue for your grammar is because you updated the submodule but not the cached license file. You can fix this by running: bundle exec licensed cache -c vendor/licenses/config.yml and commit just the updated cache file.

@Akzestia
Copy link
Copy Markdown
Contributor Author

Akzestia commented Jan 8, 2026

The ArkTS grammar issue is being addressed by the revert in #7737.

The license cache issue for your grammar is because you updated the submodule but not the cached license file. You can fix this by running: bundle exec licensed cache -c vendor/licenses/config.yml and commit just the updated cache file.

Done

Copy link
Copy Markdown
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

Important

The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.

@lildude lildude added this pull request to the merge queue Jan 12, 2026
Merged via the queue into github-linguist:main with commit 099a91f Jan 12, 2026
5 checks passed
github-merge-queue Bot pushed a commit to zed-industries/extensions that referenced this pull request Feb 8, 2026
## PR Summary

> [!TIP]
> Release v3.0.0 contains breaking changes involving language server
</br>
> Since v3.0.0 binary name was renamed to `cqlls` 
> ```rs
> impl CqlLspExtension {
>    fn get_path_to_language_server_executable()
>      ...
>      let binary_name = "cqlls";
> ```
> New crates.io [entry](https://crates.io/crates/cqlls) <br>
> ```sh
> cargo install cqlls
> ```

## Changes: 
- **Extension**: binary name changed to cqlls
- **Language Server**: [Insert
Preview](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#inset-preview
)
- **Language Server**: [INSERT INTO
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#inset-formatting
)
- **Language Server**: [CREATE AGGREGATE
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#caggregate-formatting)
- **Language Server**: [CREATE FUNCTION
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#cfunc-formatting)
- **Language Server**: [ALTER TABLE
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#alter-table-formatting)
- **Language Server**: [TLS
connections](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#tls)
- **Language Server**: [Non-UTF8
support](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#utf8)
- **Github** [CQL as it's own
language](github-linguist/linguist#7720)

## Issues Fixed

- [Support indentation for
INSERT](Akzestia/cqlls#30)
- [Support TLS connection](Akzestia/cqlls#31)
- [UTF-16 && UTF-32 Causing Language Server to
panic](Akzestia/cqlls#32)
- [Support indentation for CREATE
AGGREGATE](Akzestia/cqlls#37)
- [Support indentation for CREATE
FUNCTION](Akzestia/cqlls#38)
- [Support indentation for ALTER
TABLE](Akzestia/cqlls#39)

Full release
[notes](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0) for
language server.
cramhead pushed a commit to cramhead/extensions that referenced this pull request Mar 31, 2026
## PR Summary

> [!TIP]
> Release v3.0.0 contains breaking changes involving language server
</br>
> Since v3.0.0 binary name was renamed to `cqlls` 
> ```rs
> impl CqlLspExtension {
>    fn get_path_to_language_server_executable()
>      ...
>      let binary_name = "cqlls";
> ```
> New crates.io [entry](https://crates.io/crates/cqlls) <br>
> ```sh
> cargo install cqlls
> ```

## Changes: 
- **Extension**: binary name changed to cqlls
- **Language Server**: [Insert
Preview](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#inset-preview
)
- **Language Server**: [INSERT INTO
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#inset-formatting
)
- **Language Server**: [CREATE AGGREGATE
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#caggregate-formatting)
- **Language Server**: [CREATE FUNCTION
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#cfunc-formatting)
- **Language Server**: [ALTER TABLE
formatting](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#alter-table-formatting)
- **Language Server**: [TLS
connections](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#tls)
- **Language Server**: [Non-UTF8
support](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0#utf8)
- **Github** [CQL as it's own
language](github-linguist/linguist#7720)

## Issues Fixed

- [Support indentation for
INSERT](Akzestia/cqlls#30)
- [Support TLS connection](Akzestia/cqlls#31)
- [UTF-16 && UTF-32 Causing Language Server to
panic](Akzestia/cqlls#32)
- [Support indentation for CREATE
AGGREGATE](Akzestia/cqlls#37)
- [Support indentation for CREATE
FUNCTION](Akzestia/cqlls#38)
- [Support indentation for ALTER
TABLE](Akzestia/cqlls#39)

Full release
[notes](https://github.com/Akzestia/cqlls/releases/tag/v2.0.0) for
language server.
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants