Metadata-Version: 2.4
Name: sqlmesh-gizmosql
Version: 0.1.3
Summary: GizmoSQL engine adapter for SQLMesh
Author-email: Philip Moore <philip@gizmodata.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/gizmodata/sqlmesh-gizmosql
Project-URL: Repository, https://github.com/gizmodata/sqlmesh-gizmosql
Project-URL: Documentation, https://github.com/gizmodata/sqlmesh-gizmosql#readme
Keywords: sqlmesh,gizmosql,duckdb,arrow,flight-sql,data-engineering
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: sqlmesh>=0.100.0
Requires-Dist: adbc-driver-flightsql>=1.10.0
Requires-Dist: pyarrow>=22.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"

# SQLMesh GizmoSQL Adapter

A [SQLMesh](https://sqlmesh.com) engine adapter for [GizmoSQL](https://github.com/gizmodata/gizmosql) - a database server that uses DuckDB as its execution engine and exposes an Arrow Flight SQL interface for remote connections.

[<img src="https://img.shields.io/badge/GitHub-gizmodata%2Fsqlmesh--gizmosql-blue.svg?logo=Github">](https://github.com/gizmodata/sqlmesh-gizmosql)
[<img src="https://img.shields.io/badge/GitHub-gizmodata%2Fgizmosql-blue.svg?logo=Github">](https://github.com/gizmodata/gizmosql)
[![sqlmesh-gizmosql-ci](https://github.com/gizmodata/sqlmesh-gizmosql/actions/workflows/ci.yml/badge.svg)](https://github.com/gizmodata/sqlmesh-gizmosql/actions/workflows/ci.yml)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/sqlmesh-gizmosql)](https://pypi.org/project/sqlmesh-gizmosql/)
[![PyPI version](https://badge.fury.io/py/sqlmesh-gizmosql.svg)](https://badge.fury.io/py/sqlmesh-gizmosql)
[![PyPI Downloads](https://img.shields.io/pypi/dm/sqlmesh-gizmosql.svg)](https://pypi.org/project/sqlmesh-gizmosql/)

## Installation

```bash
pip install sqlmesh-gizmosql
```

This will install `sqlmesh`, `adbc-driver-flightsql`, and `pyarrow` as dependencies.

## Usage

### 1. Import the adapter

Simply import the package before using SQLMesh. The adapter registers itself automatically:

```python
import sqlmesh_gizmosql  # Registers GizmoSQL adapter
from sqlmesh import Context

context = Context(paths="path/to/project")
```

### 2. Configure your connection

Add a GizmoSQL connection to your `config.yaml`:

```yaml
gateways:
  my_gizmosql:
    connection:
      type: gizmosql
      host: localhost
      port: 31337
      username: your_username
      password: your_password
      database: my_database  # optional, default catalog
      use_encryption: true   # default: true (uses TLS)
      disable_certificate_verification: false  # for self-signed certs
```

### 3. Use SQLMesh as normal

```bash
sqlmesh plan
sqlmesh run
```

## Configuration Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `host` | str | `localhost` | GizmoSQL server hostname |
| `port` | int | `31337` | GizmoSQL server port |
| `username` | str | *required* | Authentication username |
| `password` | str | *required* | Authentication password |
| `database` | str | `None` | Default database/catalog |
| `use_encryption` | bool | `True` | Use TLS encryption |
| `disable_certificate_verification` | bool | `False` | Skip TLS cert verification |
| `concurrent_tasks` | int | `4` | Max concurrent tasks |
| `register_comments` | bool | `True` | Register model comments |
| `pre_ping` | bool | `False` | Pre-ping connections |

## Features

- **Arrow Flight SQL**: Efficient data transfer using Arrow's columnar format
- **Full Catalog Support**: Create, drop, and switch between databases
- **Transaction Support**: Full transaction control via SQL statements
- **ADBC Bulk Ingestion**: Fast data loading using Arrow-native bulk operations
- **DuckDB Compatibility**: Uses DuckDB SQL dialect for query generation

## Requirements

- Python >= 3.10
- SQLMesh >= 0.100.0
- A running GizmoSQL server with DuckDB backend

## Development

```bash
# Clone the repository
git clone https://github.com/gizmodata/sqlmesh-gizmosql.git
cd sqlmesh-gizmosql

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
ruff check .
mypy sqlmesh_gizmosql
```

## License

Apache 2.0
