Skip to main content

sqlakit-lsp

The language server for SQLAKit templates. In a .sql template:

  • the problems sqlakit check finds, as you type
  • completion after tpl. and in tpl.include(', and a macro's arguments while you write them
  • on hover, the SQL a call writes, above the macro's signature and docstring
  • go to definition, implementation and references of a macro or a template
  • rename of a macro or a template across the project
  • the macros' calls and the parameters coloured
  • a parameter no call of the project passes, marked, with a quick fix for a name close to one the calls pass
  • Show rendered SQL, the whole template as the SQL it writes
  • the outline of a template, and a search for a macro or a template

In Python, the template name in db.sql("...") completes and links to its file, and a value the template does not read is marked.

$ pip install sqlakit-lsp

Register sqlakit-lsp for .sql and .py files in your editor. It talks over stdio. In Neovim 0.11:

vim.lsp.config("sqlakit", {
  cmd = { "sqlakit-lsp" },
  filetypes = { "sql", "python" },
  root_markers = { "pyproject.toml" },
})
vim.lsp.enable("sqlakit")

Zed colours the macros' calls and the parameters of a template from the server once its settings say "semantic_tokens": "combined".

It reads the project the way sqlakit check does, from the Templates(...) the code builds, without running it. SQL templates covers what it reads, and [tool.sqlakit.templates] for a project whose code builds its paths in a way it can't follow.

Development

$ uv sync
$ uv run poe test
$ uv run poe lint

Release files for sqlakit-lsp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlakit-lsp 0.1.0
File Size Uploaded
sqlakit_lsp-0.1.0.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlakit-lsp 0.1.0
File Interpreter ABI Platform
sqlakit_lsp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.2 kB

Release files / sqlakit_lsp-0.1.0.tar.gz

Download URL sqlakit_lsp-0.1.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ee9d71baa5aad3503d56a4f8938a457b9719f4a1aa0aebf2900efd46a2c16464
BLAKE2b-256 checksum
How to use checksums
74df624098f9040b63ba5fe465c12dab4552d360ba9946f67599be141fde07ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / sqlakit_lsp-0.1.0-py3-none-any.whl

Download URL sqlakit_lsp-0.1.0-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90d45b566a4cb1baf08034745488f6583de74b64ee2911b661b1604732be3a99
BLAKE2b-256 checksum
How to use checksums
29163327e147bc8b0a5ea7e0a4b4687cb82d9bb90dfacef1ebbb39f5679b0731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page