nl2sql-sdk
The interfaces an extension for the
nl2sql engine implements: database
adapters and secret providers. The import package is nl2sql_sdk. It depends
on pydantic and the standard library only, so an extension built against it
inherits nothing else.
DatasourceAdapterProtocol:capabilities(),connect(),fetch_schema_snapshot(),execute(request)andget_dialect(), which returns a sqlglot dialect name such aspostgresortsql. An adapter class also declaresinterface_version = 1, thedriver_modulesit needs and aninstall_hintfor when one is missing.AdapterRequest,ResultFrameandResultError: what the engine sends an adapter and what it gets back.SchemaSnapshotand the table, column and foreign-key contracts an adapter describes its schema with.SecretProvider:interface_version = 1, a strictconfig_modelfor its block in the secrets config,from_config(cfg)andget_secret(key).
An adapter is published as an nl2sql.adapters entry point, and the engine
finds it there; it never imports an adapter by name.
pip install nl2sql-sdk
Writing an adapter: Adapter development. Try the engine without installing anything: https://nl2sql.codewithnk.com.
Metadata
Release files for nl2sql-sdk 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nl2sql_sdk-0.5.0.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nl2sql_sdk-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / nl2sql_sdk-0.5.0.tar.gz
| Download URL | nl2sql_sdk-0.5.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d36bd77b5658f72edb97c86eb16ebb1022b9fe68d733c79f5a6da5348e12f2f2
|
|
BLAKE2b-256 checksum How to use checksums |
60c951401ea9ecb562802b4de6ee862b867791bfeb68c791b857c4110de9628a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / nl2sql_sdk-0.5.0-py3-none-any.whl
| Download URL | nl2sql_sdk-0.5.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1247c780208d1b1484c103ca8244764cea1f3a32ca986acfd27916036efd8404
|
|
BLAKE2b-256 checksum How to use checksums |
44608968a188846358842852440f5d1f820d1e054a3c8f892909364fdb52cd74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|