Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #326 from krassowski/add-sql-server
Add sql-language-server
- Loading branch information
Showing
12 changed files
with
1,409 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT * FR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
py_src/jupyter_lsp/specs/config/sql-language-server.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"properties": { | ||
"personalConfig": { | ||
"connections": { | ||
"type": "array", | ||
"default": [ | ||
{ | ||
"name": "default sqlite3 connection", | ||
"adapter": "sqlite3", | ||
"filename": ":memory:", | ||
"projectPaths": ["."] | ||
} | ||
], | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "Connection name (free-form text)", | ||
"type": "string" | ||
}, | ||
"adapter": { | ||
"description": "Database type", | ||
"type": "string", | ||
"enum": ["mysql", "postgresql", "postgres", "sqlite3"] | ||
}, | ||
"host": { | ||
"description": "Database host", | ||
"type": "string" | ||
}, | ||
"port": { | ||
"description": "Database port", | ||
"type": "number" | ||
}, | ||
"user": { | ||
"description": "Database user", | ||
"type": "string" | ||
}, | ||
"database": { | ||
"description": "Database name", | ||
"type": "string" | ||
}, | ||
"password": { | ||
"description": "Database password", | ||
"type": "string" | ||
}, | ||
"filename": { | ||
"description": "Database filename - only for sqlite3 (required); use ':memory:' for in-memory database", | ||
"type": "string" | ||
}, | ||
"projectPaths": { | ||
"description": "Project path that you want to apply (if you don't set it configuration will not apply automatically when lsp's started up)", | ||
"type": "array", | ||
"items": { "type": "string" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from .config import load_config_schema | ||
from .utils import NodeModuleSpec | ||
|
||
|
||
class SQLLanguageServer(NodeModuleSpec): | ||
"""Supports mysql, postgres and sqlite3""" | ||
|
||
node_module = key = "sql-language-server" | ||
script = ["dist", "bin", "cli.js"] | ||
languages = [ | ||
"sql", | ||
] | ||
args = ["up", "--method", "stdio"] | ||
spec = dict( | ||
display_name=key, | ||
mime_types=[ | ||
"application/sql", | ||
"text/sql", | ||
"text/x-sql", | ||
"text/x-mysql", | ||
"text/x-mariadb", | ||
"text/x-pgsql", | ||
], | ||
urls=dict( | ||
home="https://github.com/joe-re/{}".format(key), | ||
issues="https://github.com/joe-re/{}/issues".format(key), | ||
), | ||
install=dict( | ||
npm="npm install --save-dev {}".format(key), | ||
yarn="yarn add --dev {}".format(key), | ||
jlpm="jlpm add --dev {}".format(key), | ||
), | ||
config_schema=load_config_schema(key), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.