Thanks for contributing to the nl2sql monorepo. This guide covers local setup,
tests, documentation, and adapter development.
packages/core: Core engine and pipeline.packages/api: FastAPI REST service.packages/adapter-sdk: Adapter interfaces and contracts.packages/adapter-sqlalchemy: SQLAlchemy adapter base.packages/adapters/*: Database adapter implementations.docs/: MkDocs documentation.
- Python 3.10+
- Docker (required for integration tests that spin up databases)
- Clone the repository.
- Create and activate a virtual environment.
- Install editable packages you plan to work on.
Example (PowerShell):
python -m venv venv
.\venv\Scripts\activate
python -m pip install -e packages/adapter-sdk
python -m pip install -e packages/core
python -m pip install -e packages/adapter-sqlalchemy
python -m pip install -e packages/adapters/postgresUnit tests:
pytest packages/core/tests/unitIntegration tests (requires Docker):
./scripts/test_integration.ps1Docs are built with MkDocs. To run locally:
python -m pip install -r requirements-docs.txt
mkdocs serve- Create a feature branch (e.g.,
feat/my-change). - Make changes and run relevant tests.
- Open a pull request with a clear summary and test plan.
Choose the base class that matches your datasource:
| Base | Package | Use Case | Dependencies |
|---|---|---|---|
BaseSQLAlchemyAdapter |
adapter-sqlalchemy |
Relational databases | SQLAlchemy |
DatasourceAdapter (protocol) |
adapter-sdk |
Non-SQL or custom sources | None |
Implement BaseSQLAlchemyAdapter to inherit schema fetch and execution.
from nl2sql_sqlalchemy_adapter import BaseSQLAlchemyAdapter
class MyDbAdapter(BaseSQLAlchemyAdapter):
def connect(self, config):
...Implement the DatasourceAdapter protocol directly.
from nl2sql_adapter_sdk import DatasourceAdapter
class MyApiAdapter(DatasourceAdapter):
...- Architecture and system behavior:
docs/architecture/ - Core API reference:
docs/api/core/ - REST API reference:
docs/api/rest/