Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/concepts/models/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ This table lists each engine's support for `TABLE` and `VIEW` object comments:
| Redshift | Y | N |
| Snowflake | Y | Y |
| Spark | Y | Y |
| StarRocks | Y | Y |
| Trino | Y | Y |


Expand Down
7 changes: 5 additions & 2 deletions docs/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -929,19 +929,22 @@ Example snowflake connection configuration:
These pages describe the connection configuration options for each execution engine.

* [Athena](../integrations/engines/athena.md)
* [Azure SQL](../integrations/engines/azuresql.md)
* [BigQuery](../integrations/engines/bigquery.md)
* [ClickHouse](../integrations/engines/clickhouse.md)
* [Databricks](../integrations/engines/databricks.md)
* [DuckDB](../integrations/engines/duckdb.md)
* [Fabric](../integrations/engines/fabric.md)
* [MotherDuck](../integrations/engines/motherduck.md)
* [MySQL](../integrations/engines/mysql.md)
* [MSSQL](../integrations/engines/mssql.md)
* [MySQL](../integrations/engines/mysql.md)
* [Postgres](../integrations/engines/postgres.md)
* [GCP Postgres](../integrations/engines/gcp-postgres.md)
* [Redshift](../integrations/engines/redshift.md)
* [RisingWave](../integrations/engines/risingwave.md)
* [Snowflake](../integrations/engines/snowflake.md)
* [StarRocks](../integrations/engines/starrocks.md)
* [Spark](../integrations/engines/spark.md)
* [StarRocks](../integrations/engines/starrocks.md)
* [Trino](../integrations/engines/trino.md)

#### State connection
Expand Down
7 changes: 6 additions & 1 deletion docs/guides/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@ default_gateway: local_db

## Supported engines

* [Athena](../integrations/engines/athena.md)
* [Azure SQL](../integrations/engines/azuresql.md)
* [BigQuery](../integrations/engines/bigquery.md)
* [ClickHouse](../integrations/engines/clickhouse.md)
* [Databricks](../integrations/engines/databricks.md)
* [DuckDB](../integrations/engines/duckdb.md)
* [Fabric](../integrations/engines/fabric.md)
* [MotherDuck](../integrations/engines/motherduck.md)
* [MySQL](../integrations/engines/mysql.md)
* [MSSQL](../integrations/engines/mssql.md)
* [MySQL](../integrations/engines/mysql.md)
* [Postgres](../integrations/engines/postgres.md)
* [GCP Postgres](../integrations/engines/gcp-postgres.md)
* [Redshift](../integrations/engines/redshift.md)
* [RisingWave](../integrations/engines/risingwave.md)
* [Snowflake](../integrations/engines/snowflake.md)
* [Spark](../integrations/engines/spark.md)
* [StarRocks](../integrations/engines/starrocks.md)
Expand Down
3 changes: 3 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ Other extras are required to use specific SQL engines, like Bigquery or Postgres
| Bigquery | `pip install "sqlmesh[bigquery]"` |
| ClickHouse | `pip install "sqlmesh[clickhouse]"` |
| Databricks | `pip install "sqlmesh[databricks]"` |
| Fabric | `pip install "sqlmesh[fabric]"` |
| GCP Postgres | `pip install "sqlmesh[gcppostgres]"` |
| MS SQL Server | `pip install "sqlmesh[mssql]"` |
| MotherDuck | `pip install "sqlmesh[motherduck]"` |
| MySQL | `pip install "sqlmesh[mysql]"` |
| Postgres | `pip install "sqlmesh[postgres]"` |
| Redshift | `pip install "sqlmesh[redshift]"` |
| RisingWave | `pip install "sqlmesh[risingwave]"` |
| Snowflake | `pip install "sqlmesh[snowflake]"` |
| StarRocks | `pip install "sqlmesh[starrocks]"` |
| Trino | `pip install "sqlmesh[trino]"` |

Multiple extras can be installed at once, as in `pip install "sqlmesh[github,slack]"`.
Expand Down
2 changes: 2 additions & 0 deletions docs/quickstart/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Choose your SQL engine:
[14] MySQL
[15] Athena
[16] RisingWave
[17] Fabric
[18] StarRocks

Enter a number: 1
```
Expand Down
6 changes: 5 additions & 1 deletion docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,22 @@ Most parameters are specific to the connection engine `type` - see [below](#engi
These pages describe the connection configuration options for each execution engine.

* [Athena](../integrations/engines/athena.md)
* [Azure SQL](../integrations/engines/azuresql.md)
* [BigQuery](../integrations/engines/bigquery.md)
* [ClickHouse](../integrations/engines/clickhouse.md)
* [Databricks](../integrations/engines/databricks.md)
* [DuckDB](../integrations/engines/duckdb.md)
* [Fabric](../integrations/engines/fabric.md)
* [MotherDuck](../integrations/engines/motherduck.md)
* [MySQL](../integrations/engines/mysql.md)
* [MSSQL](../integrations/engines/mssql.md)
* [MySQL](../integrations/engines/mysql.md)
* [Postgres](../integrations/engines/postgres.md)
* [GCP Postgres](../integrations/engines/gcp-postgres.md)
* [Redshift](../integrations/engines/redshift.md)
* [RisingWave](../integrations/engines/risingwave.md)
* [Snowflake](../integrations/engines/snowflake.md)
* [Spark](../integrations/engines/spark.md)
* [StarRocks](../integrations/engines/starrocks.md)
* [Trino](../integrations/engines/trino.md)

### Scheduler
Expand Down
28 changes: 27 additions & 1 deletion tests/web/test_main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import threading
from pathlib import Path
from pathlib import Path, PureWindowsPath

import pyarrow as pa # type: ignore
import pytest
Expand Down Expand Up @@ -75,6 +75,32 @@ def test_get_file(client: TestClient, project_tmp_path: Path) -> None:
}


def test_get_file_nested_path_matches_directory_listing(
client: TestClient, project_tmp_path: Path
) -> None:
models_dir = project_tmp_path / "models"
models_dir.mkdir()
(models_dir / "mymodel.sql").write_text("SELECT 1")

response = client.get("/api/files/models/mymodel.sql")
assert response.status_code == 200
assert response.json()["path"] == "models/mymodel.sql"


def test_get_file_relative_path_uses_posix_separators(tmp_path: Path) -> None:
file_path = tmp_path / "models" / "mymodel.sql"
file_path.parent.mkdir(parents=True)
file_path.write_text("SELECT 1")

windows_relative = PureWindowsPath("models/mymodel.sql")
assert windows_relative.as_posix() == "models/mymodel.sql"
assert str(windows_relative) == "models\\mymodel.sql"

file = _get_file_with_content(file_path, windows_relative.as_posix())
assert file.path == "models/mymodel.sql"
assert file.path != str(windows_relative)


def test_get_file_not_found(client: TestClient) -> None:
response = client.get("/api/files/not_found.txt")
assert response.status_code == 404
Expand Down
4 changes: 2 additions & 2 deletions web/server/api/endpoints/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_file(
"""Get a file, including its contents."""
try:
file_path = Path(path)
file = _get_file_with_content(settings.project_path / file_path, str(file_path))
file = _get_file_with_content(settings.project_path / file_path, file_path.as_posix())
except FileNotFoundError:
raise HTTPException(status_code=HTTP_404_NOT_FOUND)

Expand Down Expand Up @@ -155,7 +155,7 @@ def walk_path(
return sorted(directories, key=lambda x: x.name), sorted(files, key=lambda x: x.name)

directories, files = walk_path(path)
relative_path = str(Path(path).relative_to(settings.project_path))
relative_path = Path(path).relative_to(settings.project_path).as_posix()

return models.Directory(
name=os.path.basename(path),
Expand Down
6 changes: 3 additions & 3 deletions web/server/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def watch_project() -> None:
changes.append(
models.ArtifactChange(
change=Change.deleted,
path=str(relative_path),
path=relative_path.as_posix(),
)
)
elif change == Change.added:
Expand All @@ -69,9 +69,9 @@ async def watch_project() -> None:
models.ArtifactChange(
type=models.ArtifactType.file,
change=change,
path=str(relative_path),
path=relative_path.as_posix(),
file=_get_file_with_content(
settings.project_path / relative_path, str(relative_path)
settings.project_path / relative_path, relative_path.as_posix()
),
)
)
Expand Down
Loading