All Projects → lighttiger2505 → Sqls

lighttiger2505 / Sqls

Licence: mit
SQL language server written in Go.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Sqls

Ale
Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP) support
Stars: ✭ 11,380 (+3680.73%)
Mutual labels:  language-server-protocol, autocomplete
Vim Lsc
A vim plugin for communicating with a language server
Stars: ✭ 545 (+81.06%)
Mutual labels:  language-server-protocol, autocomplete
Hue
Open source SQL Query Assistant service for Databases/Warehouses
Stars: ✭ 351 (+16.61%)
Mutual labels:  sql, autocomplete
Php Language Server
PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
Stars: ✭ 1,019 (+238.54%)
Mutual labels:  language-server-protocol, autocomplete
Intelephense
Intellisense for PHP
Stars: ✭ 212 (-29.57%)
Mutual labels:  language-server-protocol, autocomplete
Lua Lsp
A Lua language server
Stars: ✭ 219 (-27.24%)
Mutual labels:  language-server-protocol, autocomplete
Sql Language Server
SQL Language Server
Stars: ✭ 210 (-30.23%)
Mutual labels:  sql, language-server-protocol
Text2sql Data
A collection of datasets that pair questions with SQL queries.
Stars: ✭ 287 (-4.65%)
Mutual labels:  sql
Goql
A golang source code scanner, this time in sql :)
Stars: ✭ 295 (-1.99%)
Mutual labels:  sql
Sql Parser
A validating SQL lexer and parser with a focus on MySQL dialect.
Stars: ✭ 284 (-5.65%)
Mutual labels:  sql
Selectmenu
Simple, easily and diversity menu solution
Stars: ✭ 284 (-5.65%)
Mutual labels:  autocomplete
Crate
CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of data in real-time.
Stars: ✭ 3,254 (+981.06%)
Mutual labels:  sql
Lsp4j
A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
Stars: ✭ 293 (-2.66%)
Mutual labels:  language-server-protocol
Android Nosql
Lightweight, simple structured NoSQL database for Android
Stars: ✭ 284 (-5.65%)
Mutual labels:  sql
Gowapt
Go Web Application Penetration Test
Stars: ✭ 300 (-0.33%)
Mutual labels:  sql
Sq
swiss-army knife for data
Stars: ✭ 275 (-8.64%)
Mutual labels:  sql
Compliment
The Clojure completion library you deserve
Stars: ✭ 302 (+0.33%)
Mutual labels:  autocomplete
Elm Language Server
Language server implementation for Elm
Stars: ✭ 298 (-1%)
Mutual labels:  language-server-protocol
Scry
Scry is a code analysis server for https://crystal-lang.org
Stars: ✭ 294 (-2.33%)
Mutual labels:  language-server-protocol
Requery
requery - modern SQL based query & persistence for Java / Kotlin / Android
Stars: ✭ 3,071 (+920.27%)
Mutual labels:  sql

sqls

test

An implementation of the Language Server Protocol for SQL.

Note

This project is currently under development and there is no stable release. Therefore, destructive interface changes and configuration changes are expected.

Features

sqls aims to provide advanced intelligence for you to edit sql in your own editor.

Support RDBMS

Language Server Features

Auto Completion

completion

  • DML(Data Manipulation Language)
    • [x] SELECT
      • [x] Sub Query
    • [x] INSERT
    • [x] UPDATE
    • [x] DELETE
  • DDL(Data Definition Language)
    • [ ] CREATE TABLE
    • [ ] ALTER TABLE

CodeAction

code_actions

  • [x] Execute SQL
  • [ ] Explain SQL
  • [x] Switch Connection(Selected Database Connection)
  • [x] Switch Database

Hover

hover

Signature Help

signature_help

Document Formatting

document_format

Installation

go get github.com/lighttiger2505/sqls

Editor Plugins

DB Configuration

The connection to the RDBMS is essential to take advantage of the functionality provided by sqls. You need to set the connection to the RDBMS.

Configuration Methods

There are the following methods for RDBMS connection settings, and they are prioritized in order from the top. Whichever method you choose, the settings you make will remain the same.

  1. Configuration file specified by the -config flag
  2. workspace/configuration set to LSP client
  3. Configuration file located in the following location
    • $XDG_CONFIG_HOME/sqls/config.yml ("$HOME/.config" is used instead of $XDG_CONFIG_HOME if it's not set)

Configuration file sample

# Set to true to use lowercase keywords instead of uppercase.
lowercaseKeywords: false
connections:
  - alias: dsn_mysql
    driver: mysql
    dataSourceName: root:[email protected](127.0.0.1:13306)/world
  - alias: individual_mysql
    driver: mysql
    proto: tcp
    user: root
    passwd: root
    host: 127.0.0.1
    port: 13306
    dbName: world
    params:
      autocommit: "true"
      tls: skip-verify
  - alias: mysql_via_ssh
    driver: mysql
    proto: tcp
    user: admin
    passwd: Q+ACgv12ABx/
    host: 192.168.121.163
    port: 3306
    dbName: world
    sshConfig:
      host: 192.168.121.168
      port: 22
      user: sshuser
      passPhrase: ssspass
      privateKey: /home/lighttiger2505/.ssh/id_rsa

Workspace configuration Sample

  • setting example with vim-lsp.
if executable('sqls')
    augroup LspSqls
        autocmd!
        autocmd User lsp_setup call lsp#register_server({
        \   'name': 'sqls',
        \   'cmd': {server_info->['sqls']},
        \   'whitelist': ['sql'],
        \   'workspace_config': {
        \     'sqls': {
        \       'connections': [
        \         {
        \           'driver': 'mysql',
        \           'dataSourceName': 'root:[email protected](127.0.0.1:13306)/world',
        \         },
        \         {
        \           'driver': 'postgresql',
        \           'dataSourceName': 'host=127.0.0.1 port=15432 user=postgres password=mysecretpassword1234 dbname=dvdrental sslmode=disable',
        \         },
        \       ],
        \     },
        \   },
        \ })
    augroup END
endif
  • setting example with coc.nvim.

In coc-settings.json opened by :CocConfig

{
    "languageserver": {
        "sql": {
            "command": "sqls",
            "args": ["-config", "$HOME/.config/sqls/config.yml"],
            "filetypes": ["sql"],
            "shell": true
        }
    }
}
require'lspconfig'.sqls.setup{
  settings = {
    sqls = {
      connections = {
        {
          driver = 'mysql',
          dataSourceName = 'root:[email protected](127.0.0.1:13306)/world',
        },
        {
          driver = 'postgresql',
          dataSourceName = 'host=127.0.0.1 port=15432 user=postgres password=mysecretpassword1234 dbname=dvdrental sslmode=disable',
        },
      },
    },
  },
}

I'm sorry. Please wait a little longer for other editor settings.

Configuration Params

The first setting in connections is the default connection.

Key Description
connections Database connections

connections

dataSourceName takes precedence over the value set in proto, user, passwd, host, port, dbName, params.

Key Description
alias Connection alias name. Optional.
driver mysql, postgresql, sqlite3. Required.
dataSourceName Data source name.
proto tcp, udp, unix.
user User name
passwd Password
host Host
port Port
path unix socket path
dbName Database name
params Option params. Optional.
sshConfig ssh config. Optional.

sshConfig

Key Description
host ssh host. Required.
port ssh port. Required.
user ssh user. Optional.
privateKey private key path. Required.
passPhrase passPhrase. Optional.

DSN (Data Source Name)

See also.

Contributors

This project exists thanks to all the people who contribute.

Inspired

I created sqls inspired by the following OSS.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].