No project description provided
Project description
sql-lsp
A language server for SQL. This server currently supports only MySQL (and MariaDB) for now with plans to add more dialects in the future. This package is under active development and doesn't not have a stable release yet but any use and feedback is highly appreciated!
Installation
This package provides sql-ls
which is a language server written with the help
of pygls
. It can be installed
directly using pip
pip install sql-lsp
Features and Usage
The language server can be used by starting in the stdio
mode
sql-ls --stdio
The server gets the completion information by connecting to the database and
fetching the metadata regarding the tables. The database connection is
configured based on connections provided in the configuration file for the
project. The server expects .sql-ls/config.json
at the root of the project.
An example config.json
{
"connections": {
"localhost": {
"driver": "mariadb",
"host": "localhost",
"username": "username",
"password": "password",
"database": "mysql"
}
}
}
The connections can be switched using the Switch Connection
code action.
sql-ls
provides completion and query execution.
Editor Integration
Emacs
This server integrates well with the eglot
language server client. Once the
server in installed, it can be configured for sql-mode
by adding the following
configuration
(add-to-list 'eglot-server-programs
'((sql-mode)
. ("sql-ls" "--stdio")))
To enable all abilities for the language server, apply the patch provided in the
repository in the file eglot.patch
to eglot.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sql_lsp-0.0.7.tar.gz
.
File metadata
- Download URL: sql_lsp-0.0.7.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.6.31
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 371d9c196f2fa38189ccd9aa56e3f6ad781dbbde1966522c9a9dc56788543716 |
|
MD5 | c680096db41a707b98676c501262ec54 |
|
BLAKE2b-256 | 6104db8c1d923b3840672197e549c34ed3ad24a46e49f703d9dace087df02983 |
File details
Details for the file sql_lsp-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: sql_lsp-0.0.7-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.6.31
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49738b0f5bc8a3359418491b62ff031e6c29cae012db1bc376953a7df3e806b4 |
|
MD5 | 2b9ce11d2840b050dfd18923d9f81ddf |
|
BLAKE2b-256 | aa22353c209f8f58dd020945ab3d0d8e8de83f34993175b3c4156a2f21466447 |