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.2.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.2.0
File Size Uploaded
sqlakit_lsp-0.2.0.tar.gz 28.1 kB Details

Built distribution (wheel)

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

Total release size: 57.2 kB

Release files / sqlakit_lsp-0.2.0.tar.gz

Download URL sqlakit_lsp-0.2.0.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
360da725c497226db27092160ae09d3667ee0cb45ad429eb2bb9a2b8a2e8dc18
BLAKE2b-256 checksum
How to use checksums
236947f459eff308881d1d87648c1e2f07c8477010941ff246c66b09480c79ec
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.2.0-py3-none-any.whl

Download URL sqlakit_lsp-0.2.0-py3-none-any.whl
Size 29.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd409125085e00160c69474eb2afcc99588cdbc56d2b99a2f3619ee7fb522f20
BLAKE2b-256 checksum
How to use checksums
7a15cfaf4531ed927c5c7bcdd915737509a7f8382187a0e460fd62ee951a2421
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

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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