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.1

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.1
File Size Uploaded
sqlakit_lsp-0.1.1.tar.gz 27.1 kB Details

Built distribution (wheel)

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

Total release size: 55.2 kB

Release files / sqlakit_lsp-0.1.1.tar.gz

Download URL sqlakit_lsp-0.1.1.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
be8c696d93c3dc5ccf60096f1a51040c20ce7152d3d5b4a153b48ae783543367
BLAKE2b-256 checksum
How to use checksums
bcfd453c93e7339f9706f6238e764a0064219ee9218fcea04ab6f02ab34c845a
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.1-py3-none-any.whl

Download URL sqlakit_lsp-0.1.1-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cf3817a8e1788d211b3d9e6bb006418bdfb58f16d05874c35c308625da911fd
BLAKE2b-256 checksum
How to use checksums
1f657497c1aca6515f414445bd7e5628bf066f1b119b11a69b23da89ab3245dd
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

This release

0.1.1 This release

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