sqlalchemy-lsp 0.1.5__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlalchemy_lsp-0.1.5.data/scripts/sqlalchemy-lsp.exe +0 -0
- sqlalchemy_lsp-0.1.5.dist-info/METADATA +164 -0
- sqlalchemy_lsp-0.1.5.dist-info/RECORD +6 -0
- sqlalchemy_lsp-0.1.5.dist-info/WHEEL +4 -0
- sqlalchemy_lsp-0.1.5.dist-info/licenses/LICENSE +21 -0
- sqlalchemy_lsp-0.1.5.dist-info/sboms/sqlalchemy-lsp.cyclonedx.json +4522 -0
|
Binary file
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqlalchemy-lsp
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Summary: Language server for SQLAlchemy ORM intelligence
|
|
10
|
+
Keywords: sqlalchemy,lsp,language-server,orm
|
|
11
|
+
Home-Page: https://github.com/alex-oleshkevich/sqlalchemy-lsp
|
|
12
|
+
License: MIT
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
15
|
+
|
|
16
|
+
# sqlalchemy-lsp
|
|
17
|
+
|
|
18
|
+
Language server for SQLAlchemy ORM and Alembic. Diagnostics, completions, hover, navigation, and a headless CLI linter — one Rust binary, any LSP-capable editor.
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
| | |
|
|
23
|
+
|---|---|
|
|
24
|
+
| **Diagnostics** | missing tablename, duplicate tablename/column, unknown FK table/column, FK type mismatch, relationship wiring errors, `back_populates` mismatch, uselist mismatch, orphan cascades, circular relationships, Alembic migration checks |
|
|
25
|
+
| **Completions** | FK strings, `relationship()` kwargs and values, `mapped_column()` kwargs, `__table_args__` column names, model-constructor keywords, Alembic `op.*` names and arguments, snippets |
|
|
26
|
+
| **Hover** | model card, column card (type, nullability, FK target, indexes), FK resolution, relationship card, cascade tokens, `back_populates` counterpart |
|
|
27
|
+
| **Navigation** | go-to-definition, find references, rename — models, columns, relationships, FK targets |
|
|
28
|
+
| **Signature help** | model constructors, `relationship()` kwargs |
|
|
29
|
+
| **Symbols** | models and Alembic revisions in the symbol picker |
|
|
30
|
+
| **Inlay hints** | resolved FK targets inline |
|
|
31
|
+
| **Code actions** | generate `__tablename__`, fix `back_populates`, add missing FK column |
|
|
32
|
+
| **Schema view** | ER diagram of the workspace models |
|
|
33
|
+
| **`check` CLI** | same diagnostics as the LSP — `sqlalchemy-lsp check .` |
|
|
34
|
+
|
|
35
|
+
### Diagnostics
|
|
36
|
+
|
|
37
|
+
| Code | Severity | What it catches |
|
|
38
|
+
|------|----------|----------------|
|
|
39
|
+
| `SQLA-W101` | warning | missing `__tablename__` |
|
|
40
|
+
| `SQLA-E102` | error | duplicate `__tablename__` |
|
|
41
|
+
| `SQLA-E103` | error | duplicate column name |
|
|
42
|
+
| `SQLA-E105` | error | `__table_args__` references unknown column |
|
|
43
|
+
| `SQLA-W201` | warning | `nullable=True` column typed as non-optional |
|
|
44
|
+
| `SQLA-E301` | error | FK references unknown table |
|
|
45
|
+
| `SQLA-E302` | error | FK references unknown column |
|
|
46
|
+
| `SQLA-W303` | warning | FK type mismatch |
|
|
47
|
+
| `SQLA-E401` | error | relationship target not found |
|
|
48
|
+
| `SQLA-W402` | warning | `back_populates` points at wrong attribute |
|
|
49
|
+
| `SQLA-W403` | warning | `back_populates` target not found |
|
|
50
|
+
| `SQLA-W404` | warning | `uselist` disagrees with cardinality |
|
|
51
|
+
| `SQLA-W405` | warning | relationship target mismatch |
|
|
52
|
+
| `SQLA-H406` | hint | missing FK for relationship |
|
|
53
|
+
| `SQLA-H407` | hint | one-to-one missing `unique=True` |
|
|
54
|
+
| `SQLA-W408` | warning | unknown cascade token |
|
|
55
|
+
| `SQLA-W409` | warning | `orphan` cascade without `delete` |
|
|
56
|
+
| `SQLA-H410` | hint | circular relationship |
|
|
57
|
+
|
|
58
|
+
Best-practice lints (`SQLA-W1xx`–`SQLA-H4xx`) default on and cover modernization, nullable hygiene, and Alembic migration checks.
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
uv tool install sqlalchemy-lsp
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or with pip:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install sqlalchemy-lsp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or download a pre-built binary from the [releases page](https://github.com/alex-oleshkevich/sqlalchemy-lsp/releases).
|
|
73
|
+
|
|
74
|
+
## Configuration
|
|
75
|
+
|
|
76
|
+
Zero config for standard projects. Place a `sqlalchemy-lsp.toml` or `[tool.sqlalchemy-lsp]` section in `pyproject.toml` at the project root.
|
|
77
|
+
|
|
78
|
+
```toml
|
|
79
|
+
# sqlalchemy-lsp.toml
|
|
80
|
+
|
|
81
|
+
# Path to the declarative base (auto-detected if absent)
|
|
82
|
+
# base = "app/database.py"
|
|
83
|
+
|
|
84
|
+
# Extra source roots for import resolution
|
|
85
|
+
# source_roots = ["src"]
|
|
86
|
+
|
|
87
|
+
[diagnostics]
|
|
88
|
+
# Run only these codes
|
|
89
|
+
# select = ["SQLA-E301", "SQLA-E401"]
|
|
90
|
+
|
|
91
|
+
# Suppress codes
|
|
92
|
+
ignore = ["SQLA-H406"]
|
|
93
|
+
|
|
94
|
+
# Override severity per code
|
|
95
|
+
[diagnostics.severity]
|
|
96
|
+
"SQLA-W303" = "error"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Suppress a single line with `# noqa` or `# noqa: SQLA-W303`.
|
|
100
|
+
|
|
101
|
+
## CLI
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Run diagnostics
|
|
105
|
+
sqlalchemy-lsp check .
|
|
106
|
+
sqlalchemy-lsp check app/models/ --select SQLA-E3xx --ignore SQLA-H406
|
|
107
|
+
sqlalchemy-lsp check --format json
|
|
108
|
+
|
|
109
|
+
# Print the workspace ER schema
|
|
110
|
+
sqlalchemy-lsp schema
|
|
111
|
+
|
|
112
|
+
# Print model statistics
|
|
113
|
+
sqlalchemy-lsp stats
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Editor Setup
|
|
117
|
+
|
|
118
|
+
### Zed
|
|
119
|
+
|
|
120
|
+
Install the bundled extension:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
just install-zed
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Then add to `~/.config/zed/settings.json`:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"languages": {
|
|
131
|
+
"Python": { "language_servers": ["sqlalchemy-lsp", "..."] }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Helix
|
|
137
|
+
|
|
138
|
+
Merge `editors/helix/languages.toml` into `~/.config/helix/languages.toml`.
|
|
139
|
+
|
|
140
|
+
### Neovim
|
|
141
|
+
|
|
142
|
+
Requires Neovim 0.11+. Use the snippet from `editors/neovim/sqlalchemy_lsp.lua` or add to your `init.lua`:
|
|
143
|
+
|
|
144
|
+
```lua
|
|
145
|
+
vim.lsp.config('sqlalchemy_lsp', {
|
|
146
|
+
cmd = { 'sqlalchemy-lsp', 'lsp', '--stdio' },
|
|
147
|
+
filetypes = { 'python' },
|
|
148
|
+
root_markers = { 'pyproject.toml', 'sqlalchemy-lsp.toml', 'alembic.ini', '.git' },
|
|
149
|
+
})
|
|
150
|
+
vim.lsp.enable('sqlalchemy_lsp')
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Other editors
|
|
154
|
+
|
|
155
|
+
The server speaks standard LSP over stdio:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
sqlalchemy-lsp lsp --stdio
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
MIT
|
|
164
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
sqlalchemy_lsp-0.1.5.data/scripts/sqlalchemy-lsp.exe,sha256=9n3oDaBioJeQ8luyALhipH9p45sEeTF0pgxszSRTGHU,6578688
|
|
2
|
+
sqlalchemy_lsp-0.1.5.dist-info/METADATA,sha256=-DqQpojthDPNQvIQGkaqwRyiI1J4PhsfnDhwy_Ielx4,5226
|
|
3
|
+
sqlalchemy_lsp-0.1.5.dist-info/WHEEL,sha256=2zDlIYIdD4m4N3p5DVEG3iJhGLdhsBQgdH-FqVkAur8,94
|
|
4
|
+
sqlalchemy_lsp-0.1.5.dist-info/licenses/LICENSE,sha256=yY_G-0POt8mK7mprAX3N9tCefYGJXrfAYsu2VJXYX3E,1094
|
|
5
|
+
sqlalchemy_lsp-0.1.5.dist-info/sboms/sqlalchemy-lsp.cyclonedx.json,sha256=yUFqfvygK907HDh_wPQrqRvLYWCkWQcI0E1p762ukjg,142987
|
|
6
|
+
sqlalchemy_lsp-0.1.5.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alex Oleshkevich
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|