Skip to content

Releases: Akzestia/cqlls

v4.1.0

Choose a tag to compare

@Akzestia Akzestia released this 30 May 17:39
177a424

Release 4.1.0

Crates.io

Fixes

  • Fixed incorrect indentation inside CREATE TABLE #59
  • Fixed keyspace completion logic #57
  • Fixed incorrect indentation of -- & // comments #56
  • Fixed the issue when completions for table fields inside SELECT statement weren't showing in some cases.

New Features

  • Added support for configurable indentation
  • Added support for config files .cqlls
  • New CLI commands for cqlls
    • --debug | -d Mostly for development purposes, allows you to perform Backend.formatting() and Backend.completion() on a single file.
    • --write-default-config | -wdc Writes a default config file at {current_dir}/.cqlls

Important

Since 4.1.0 configuration via env variables is no longer supported!

Full Changelog: v4.0.1...v4.1.0

v4.0.1

Choose a tag to compare

@Akzestia Akzestia released this 20 Mar 04:55
97d0afe

Release 4.0.1

Changes

  • Added -v && version CLI args.
  • Fixed single line comments not being indented inside CREATE TABLE statement

Crates.io

v4.0.0

Choose a tag to compare

@Akzestia Akzestia released this 17 Mar 22:15
f98f3d4

Release 4.0.0

Important

This release contains breaking changes!

Fixes

  • Fixed End of line comments cause incorrect indentation behavior #48
  • Fixed the issue when offset index for Data Types indent had been incorrectly calculated

New Features

  • Experimental diagnostics support #35

Breaking Changes

  • Naming for env variables was changed from CQL_LSP_* to CQL_LS*

v3.0.1

Choose a tag to compare

@Akzestia Akzestia released this 10 Feb 21:05

Fixed #46

v3.0.0

Choose a tag to compare

@Akzestia Akzestia released this 30 Jan 20:33

Release v3.0.0

Preview ^^ | Better than DataGrip

preview.mov

Table of contents

  • Formatting

    • New formatting style for INSERT INTO
    • New formatting style for CREATE AGGREGATE
    • New formatting style for CREATE FUNCTION
    • New formatting style for ALTER TABLE
  • DB Related

    • Support for TLS connections
  • General Improvements and Bug fixes

    • Non utf8 characters are no longer causing server to crash
    • Improved formatting speed by replacing old multi TextEdit with a single one
  • Quality of life improvements

    • New automation scripts, for easier cluster setup for local development
    • New tests for TLS and noTLS
  • Other changes

    • Renamed server binary from cql_lsp to cqlls
    • New entry on crates.io
      • New: cqlls
      • Old: cql_lsp
    • Addition of CQL as it's own language on github (No longer treated the same way as SQL)
  • Preview for new Insert formatting | Way better than DataGrip xD

    • The best INSERT INTO formatting on the market ^^

New INSERT INTO formatting style

New:

-- Insert users with UDT, SET, and MAP
INSERT INTO users (
    user_id,
    username,
    contact,
    addresses,
    tags,
    preferences,
    last_login,
    created_at
)
VALUES (
    uuid(),
    'alice_wonder',
    {
        email: 'alice@example.com',
        phone: '+1-555-0101',
        preferred_time: {
            'morning',
            'evening'
        }
    },
    {
        'home': {
            street: '123 Main St',
            city: 'San Francisco',
            zip_code: '94102',
            country: 'USA'
        },
        'work': {
            street: '456 Market St',
            city: 'San Francisco',
            zip_code: '94105',
            country: 'USA'
        }
    },
    {
        'premium',
        'verified',
        'early-adopter'
    },
    {
        'theme': 'dark',
        'language': 'en',
        'notifications': 'enabled'
    },
    toTimestamp(now()),
    toTimestamp(now())
);

Old:

-- Insert users with UDT,        SET, and MAP
INSERT INTO users (user_id, username, contact, addresses, tags, preferences, last_login, created_at)
VALUES (
uuid(),
'alice_wonder',
{email: 'alice@example.com', phone: '+1-555-0101', preferred_time: {'morning', 'evening'}},
{
'home': {street: '123 Main St', city: 'San Francisco', zip_code: '94102', country: 'USA'},
'work': {street: '456 Market St', city: 'San Francisco', zip_code: '94105', country: 'USA'}
},
{'premium', 'verified', 'early-adopter'},
{'theme': 'dark', 'language': 'en', 'notifications': 'enabled'},
toTimestamp(now()),
toTimestamp(now())
);

New CREATE AGGREGATE formatting style

New:

CREATE AGGREGATE cycling.average(int)
    SFUNC avgState
    STYPE tuple<int, bigint>
    FINALFUNC avgFinal
INITCOND (0, 0);

Old:

CREATE AGGREGATE cycling.average(int)
SFUNC avgState
STYPE tuple<int, bigint>
FINALFUNC avgFinal
INITCOND (0, 0);

New CREATE FUNCTION formatting style

New:

CREATE OR REPLACE FUNCTION cycling.flog (input double)
    CALLED ON NULL INPUT
    RETURNS double
    LANGUAGE java AS
$$ return Double.valueOf(Math.log(input.doubleValue())); $$;
    
CREATE OR REPLACE FUNCTION cycling.left (column text, num int)
    RETURNS NULL ON NULL INPUT
    RETURNS text
    LANGUAGE javascript AS
$$ column.substring(0, num) $$;

Old:

CREATE OR REPLACE FUNCTION cycling.flog (input double)
CALLED ON NULL INPUT
RETURNS double
LANGUAGE java AS
$$ return Double.valueOf(Math.log(input.doubleValue())); $$;
    
CREATE OR REPLACE FUNCTION cycling.left (column text, num int)
RETURNS NULL ON NULL INPUT
RETURNS text
LANGUAGE javascript AS $$ column.substring(0, num) $$;

New ALTER TABLE formatting style

Fixed the issue when previously ALTER TABLE had incorrect indentation

New:

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'
};

TLS Connections

Now you can connect to your DB using tls connection via new env variables

export CQL_LSP_TLS_MODE="none|tls"
export CQL_LSP_TLS_CA_CERT_FILE=""

Non utf8 character support

As of v2.0.0 the server will no longer crash if your file contains non utf8 characters

USE "japanese";

INSERT INTO users (
    ユーザーID,
    ユーザー名,
    連絡先,
    住所一覧,
    タグ,
    設定,
    最終ログイン,
    作成日時
)
VALUES (
    uuid(),
    '不思議の国のアリス',
    {
        メール: 'アリス@example.com',
        電話番号: '+81-90-1234-5678',
        希望連絡時間: {
            '朝',
            '夕方'
        }
    },
    {
        '自宅': {
            通り: '東京都渋谷区神宮前1-2-3',
            市区町村: '東京',
            郵便番号: '150-0001',
            国: '日本'
        },
        '職場': {
            通り: '東京都千代田区丸の内4-5-6',
            市区町村: '東京',
            郵便番号: '100-0005',
            国: '日本'
        }
    },
    {
        'プレミアム',
        '認証済み',
        '早期採用者'
    },
    {
        'テーマ': 'ダーク',
        '言語': '日本語',
        '通知': '有効'
    },
    toTimestamp(now()),
    toTimestamp(now())
);

New fulledit TextEdit

Improved formatting speed, replaced old multi TextEdit with a single full document edit

New setup.sh

Added new setup.sh script that automates cluster creation used by tests for TLS and noTLS connectivity

New tests

Added new tests for TLS.

New binary name

Starting from v2.0.0 the server binary name will be cqlls instead of cql_lsp

Tip

If you are using zed-cql extension for Zed editor, you will need to update your extension to v3.0.0 in order to use the newest language server version

New entry on crates.io

Starting from v2.0.0 the cql_lsp crate won't receive any new updates so please use the cqlls one

Tip

zed-cql v3.0.0> and cqlls v2.0.0> use

cargo install cqlls

instead of

cargo install cql_lsp

CQL as it's own language on github and github-linguist

Also a small addition to the release, you now can use cql to highlight CQL syntax on github

-- Uses ```cql instead of ```sql
USE "japanese";

INSERT INTO users (
    ユーザーID,
    ユーザー名,
    連絡先,
    住所一覧,
    タグ,
    設定,
    最終ログイン,
    作成日時
)
VALUES (
    uuid(),
    '不思議の国のアリス',
    {
        メール: 'アリス@example.com',
        電話番号: '+81-90-1234-5678',
        希望連絡時間: {
            '朝',
            '夕方'
        }
    },
    {
        '自宅': {
            通り: '東京都渋谷区神宮前1-2-3',
            市区町村: '東京',
            郵便番号: '150-0001',
            国: '日本'
        },
        '職場': {
            通り: '東京都千代田区丸の内4-5-6',
            市区町村: '東京',
            郵便番号: '100-0005',
            国: '日本'
        }
    },
    {
        'プレミアム',
        '認証済み',
        '早期採用者'
    },
    {
        'テーマ': 'ダーク',
        '言語': '日本語',
        '通知': '有効'
    },
    toTimestamp(now()),
    toTimestamp(now())
);

The best INSERT INTO formatting on the market ^^

preview.mov

Closes

v1.0.3

Choose a tag to compare

@Akzestia Akzestia released this 07 Nov 20:01

Fix for Inline spacing

Full Changelog: v1.0.1...v1.0.3

v1.0.2

Choose a tag to compare

@Akzestia Akzestia released this 29 Oct 12:22

v1.0.2

Summary

Small update that contains fixes to small formatting issues, that were present in v1.0.1

Full Changelog: v1.0.1...v1.0.1-fix-I25

v1.0.1

Choose a tag to compare

@Akzestia Akzestia released this 28 Jul 12:07

New Features

Type Alignment

Starting from v1.0.1 new env variable CQL_LSP_TYPE_ALIGNMENT_OFFSET was added to the config. This variable manages the amount of spacing between identifier and CQL type.

Important

The spacing between identifier and type is calculated like this

CQL_LSP_TYPE_ALIGNMENT_OFFSET + 1

-- CQL_LSP_TYPE_ALIGNMENT_OFFSET = 7
-- Spacing between identifier and type 8 
CREATE TABLE IF NOT EXISTS Users (
    id             UUID,
    display        TEXT,

    PRIMARY KEY((user_name))
)
-- CQL_LSP_TYPE_ALIGNMENT_OFFSET = 3
-- Spacing between identifier and type 4 
CREATE TABLE IF NOT EXISTS Users (
    id         UUID,
    display    TEXT,

    PRIMARY KEY((user_name))
)

Improvements and fixes

PRIMARY KEY not being correctly displayed if used in the end of CREATE TABLE clause

Fixed the issue when PRIMARY KEY wasn't correctly displayed if used in the end of CREATE TABLE clause

-- cql-lsp v1.0.0
CREATE TABLE IF NOT EXISTS Users (
    id         UUID,
    display    TEXT,

PRIMARY KEY((user_name))
)
-- cql-lsp v1.0.1 Fixed
CREATE TABLE IF NOT EXISTS Users (
    id         UUID,
    display    TEXT,

    PRIMARY KEY((user_name))
)

Current document not being properly updated

Fixed issue when current document wasn't properly updated, when multiple files were opened, which caused some language server features work incorrectly sometimes.

Now current document is being obtained via document url instead of member variable.

let documents = self.documents.read().await;

if let Some(document) = documents.get(document_url) {

    ...
}

Code quality and maintainability

Improved code quality and maintainability by splitting 1 single impl Backend into separate modules.

v1.0.0

├── src
│   ├── consts.rs
│   ├── cqlsh.rs
│   ├── lib.rs
│   ├── lsp.rs
│   ├── main.rs
│   ├── setup.rs
│   ├── tree_sitter.rs

v1.0.1

├── src
│   ├── completions.rs
│   ├── consts.rs
│   ├── cqlsh.rs
│   ├── formatting.rs
│   ├── handlers.rs
│   ├── lib.rs
│   ├── lsp.rs
│   ├── main.rs
│   ├── setup.rs
│   ├── tree_sitter.rs
│   └── utils.rs

Full Change log: v1.0.0...v1.0.1

v1.0.0

Choose a tag to compare

@Akzestia Akzestia released this 05 Jun 21:46

CQL Language Server Release v1.0.0

down_scaled_preview.mp4

Short Overview cql-lsp vs DataGrip (CQL Support)

Feature cql-lsp (Open Source) DataGrip (JetBrains)
License MIT (Free) Proprietary
Pricing $0 $129/year (Personal)
CQL Completion Full syntax + schema-aware Full syntax + schema-aware
Live Schema Sync ✅ Yes ✅ Yes
Type Checking ✅ Yes ✅ Yes
IDE Integration Zed, Neovim, any LSP-compatible JetBrains IDEs only
Extensibility Customizable Rust implementation Plugin system

Release Features

  • Full completion coverage for CQL syntax.
  • Context-aware completions for tables, key spaces, table columns, roles, types, indexes, views, functions && aggregates.
  • Document formatting (Spacing, indentations etc.).
  • Logging can now be disabled via an environment variable.
  • Integration with the CQL extension in Zed
  • Nvim integration via lsp-config
  • v1.0.0 now published on crates.io
  • Other small improvements, including minor pattern-matching optimizations and documentation updates.

What's Changed

Full Changelog: v0.0.1...v1.0.0

CQL (Cassandra Query Language) LSP v0.0.1 | beta

Choose a tag to compare

@Akzestia Akzestia released this 05 May 22:24

Beta LSP release as a standalone binary