Metadata-Version: 2.4
Name: dbt-ls
Version: 0.2.1
Summary: Databse aware DBT Language Server
Author-email: HuhtaLauri <huhta.lauri@gmail.com>
Requires-Python: >=3.10
Requires-Dist: ibis-framework>=12.0.0
Requires-Dist: jinja2>=3.1.6
Requires-Dist: pygls>=2.1.1
Requires-Dist: pyyaml>=6.0.3
Provides-Extra: all
Requires-Dist: ibis-framework[duckdb,mssql,mysql,postgres]>=12.0.0; extra == 'all'
Provides-Extra: duckdb
Requires-Dist: ibis-framework[duckdb]>=12.0.0; extra == 'duckdb'
Provides-Extra: mysql
Requires-Dist: ibis-framework[mysql]>=12.0.0; extra == 'mysql'
Provides-Extra: postgres
Requires-Dist: ibis-framework[postgres]>=12.0.0; extra == 'postgres'
Provides-Extra: sqlserver
Requires-Dist: ibis-framework[mssql]>=12.0.0; extra == 'sqlserver'
Description-Content-Type: text/markdown

# DBT-Language-Server

## Features

| Feature | LSP method / command | Description |
| --- | --- | --- |
| Model completion | `textDocument/completion` | Suggests dbt models inside `ref('...')` |
| Source completion | `textDocument/completion` | Suggests sources inside `source('...')`, auto-inserting the `source_name`, `table` pair   |
| Column completion | `textDocument/completion` | Suggests columns for an aliased model/source (`alias.<column>`), with the column's data type shown as a detail. |
| Go to definition | `textDocument/definition` | Jumps from `ref('model')` to that model's `.sql` file. |
| Database enrichment | on `initialize` | Reads column names and data types for models directly from the connected warehouse. |
| Catalog enrichment | on `initialize` | Reads source column info from `target/catalog.json` when available. |
| Profile resolution | on `initialize` | Locates the dbt profile, resolves the active target    |
| Auto project discovery | on `initialize` | Finds the dbt project root by locating `dbt_project.yml` (ignoring `target/`). |
| Project reload | `dbt-ls.reload` command | Re-discovers models, sources, and re-runs enrichment without restarting the server. |
| Current model info | `dbt-ls.current_model` command | Returns the dbt project root and the model's execution path for the current file. (Can be used to run models)   |


## Installation
~~~sh
uv tool install dbt-ls
~~~

## Configuration
~~~lua
vim.lsp.config("dbt_ls", {
    cmd = { "dbt-ls" },
    filetypes = { "sql" },
    root_markers = { "dbt_project.yml" },
})
vim.lsp.enable("dbt_ls")

~~~

## Supported backends
- DuckDB
- SQL Server / MSSQL
- PostgreSQL
- MySQL

Install each version with 
~~~sh
uv tool install dbt-ls[duckdb]
~~~
or all supported backends with
~~~sh
uv tool install dbt-ls[all]
~~~
