Skip to main content

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

sql_lsp-0.0.7.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

sql_lsp-0.0.7-py3-none-any.whl (13.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page