Skip to main content

Corebases

Full power of asyncpg with user friendly api of sqlalchemy.core

Corebases - is async adapter for Sqlalchemy.Core. Interface and code based on encode/databases, but has bit difference. Now supported only asycnpg driver (but It's possible to extend)

Current status - Experimental

Reason for create fork

Install

> pip install corebases

Usage

# Create a database instance, and connect to it.
from corebases import database
database = database('postgres://user:pass@localhost:5432')
await database.connect()

# Insert some data.
query = "INSERT INTO HighScores(name, score) VALUES (:name, :score)"
value =  {"name": "Daisy", "score": 92}

with database.transaction() as db:
    await db.execute(query=query, value=value)

# Run a database query.
query = "SELECT * FROM HighScores"
rows = await database.fetch_all(query=query)
print('High Scores:', rows)

await database.disconnect()

Difference between encode/databases

Principal is a bit of difference in interface on transactions:

encode/database:

with database.transaction():
    await database.execute(query=query, value=value)

corebases:

with database.transaction() as db:
    await db.execute(query=query, value=value)

Also, corebases doesn't support methods:

  • feach_val
  • execute_many

But we can add in the future.

Metadata

Release files for corebases 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for corebases 0.2.1
File Size Uploaded Provenance Actions
corebases-0.2.1.tar.gz 4.7 kB Without provenance Details for corebases-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for corebases 0.2.1
File Interpreter ABI Platform Actions
corebases-0.2.1-py3-none-any.whl Python 3 none any Details for corebases-0.2.1-py3-none-any.whl

Total release size: 10.1 kB

Release files / corebases-0.2.1.tar.gz

Download URL corebases-0.2.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
29c6b4978b7c2acd9c231a717f1d4cfcc3f3e0063bcf56517645802de937c50d
BLAKE2b-256 checksum
How to use checksums
46fb65c91415656f2855ee5f81e7ca84e778e2c0fad8292c147f6728d3509a06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.6 Linux/5.10.104-linuxkit

Release files / corebases-0.2.1-py3-none-any.whl

Download URL corebases-0.2.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20da5800f636ddb4217fa965b63f37d748416914a86759362d53d6b2896c6a97
BLAKE2b-256 checksum
How to use checksums
673757f99bb53e2827919c15d5c9a9d26842b0da25e5941814fe7285fa8f5de5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.6 Linux/5.10.104-linuxkit

Security for corebases 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page