SQLAlchemy SqlResourcePort adapter for muscles-data
Project description
muscles-data-sqlalchemy
SQLAlchemy adapter package for muscles-data.
This package is intentionally separate from muscles-data: the core package
owns typed ports, resource runtime and diagnostics, while this package owns the
SQLAlchemy-backed SqlResourcePort adapter.
Use this package when a project wants direct SQLAlchemy sessions through the
same data resource runtime without wiring muscles-sql first.
Related packages
- Core runtime and port contracts:
muscles-data - Elasticsearch search adapter:
muscles-data-elasticsearch - OpenSearch search adapter:
muscles-data-opensearch - Redis key-value/lock/stream adapter:
muscles-data-redis - Qdrant vector adapter:
muscles-data-qdrant - MongoDB document-store adapter:
muscles-data-mongodb - S3 object-store adapter:
muscles-data-s3 - Executable example:
example_data_sqlalchemy_1
Usage
Register the factory in the project composition root:
from muscles_data.catalog import DataAdapterCatalog
from muscles_data.ports import SqlResourcePort
from muscles_data.runtime import DataRuntime
from muscles_data_sqlalchemy import SqlAlchemySqlResourceFactory
catalog = DataAdapterCatalog.with_defaults()
catalog.register(SqlAlchemySqlResourceFactory())
runtime = DataRuntime(config=config, catalog=catalog)
sql = runtime.require_port("sql.local", SqlResourcePort)
Resource config stays in the project:
data:
resources:
sql.local:
type: sqlalchemy
url: sqlite:///:memory:
name: local_sqlite
pool_pre_ping: true
native_client: false
data.resources.list does not create the engine. The engine/session factory is
created lazily by session(), session_factory(), explicit native access or
data.doctor.
Application code should use SqlResourcePort; direct engine/session-factory
access is only an advanced escape hatch with native_client: true.
See muscular-example/example_data_sqlalchemy_1 for an executable example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file muscles_data_sqlalchemy-0.1.1.tar.gz.
File metadata
- Download URL: muscles_data_sqlalchemy-0.1.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4929509974c078df35ce04f3d3fd9dc5d236fcfeaffccdfb49f67333f5749e6e
|
|
| MD5 |
8227789bec9c743e70ed866dd95f6f92
|
|
| BLAKE2b-256 |
a4bf70bf64ba3e4c2720da88babc3ac0f5a429f67e6cbe2d3d912aae0c5d88aa
|
Provenance
The following attestation bundles were made for muscles_data_sqlalchemy-0.1.1.tar.gz:
Publisher:
release.yml on butkoden/muscles-data-sqlalchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muscles_data_sqlalchemy-0.1.1.tar.gz -
Subject digest:
4929509974c078df35ce04f3d3fd9dc5d236fcfeaffccdfb49f67333f5749e6e - Sigstore transparency entry: 2261287604
- Sigstore integration time:
-
Permalink:
butkoden/muscles-data-sqlalchemy@156457dbdb3f18621c8c17d581f7fe602ef911a8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/butkoden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@156457dbdb3f18621c8c17d581f7fe602ef911a8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file muscles_data_sqlalchemy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: muscles_data_sqlalchemy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa30931d44c2a0fc3150faa819e114af4dfa682496e41970439a24e2a99b5fe6
|
|
| MD5 |
f516c2ce3fab1b89c87b16cb65e7b152
|
|
| BLAKE2b-256 |
6c9a6d74cbef363418a3f2a811faf702fe5c40a269995725ff33c74653097309
|
Provenance
The following attestation bundles were made for muscles_data_sqlalchemy-0.1.1-py3-none-any.whl:
Publisher:
release.yml on butkoden/muscles-data-sqlalchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muscles_data_sqlalchemy-0.1.1-py3-none-any.whl -
Subject digest:
aa30931d44c2a0fc3150faa819e114af4dfa682496e41970439a24e2a99b5fe6 - Sigstore transparency entry: 2261287851
- Sigstore integration time:
-
Permalink:
butkoden/muscles-data-sqlalchemy@156457dbdb3f18621c8c17d581f7fe602ef911a8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/butkoden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@156457dbdb3f18621c8c17d581f7fe602ef911a8 -
Trigger Event:
release
-
Statement type: