A fast and async SQL database wrapper for Python, with support for MySQL, PostgreSQL, SQLite and MS SQL Server.
Project description
pysqlx-core
pysqlx-core is an extremely fast Python library for communicating with various SQL databases.
This package provides the core functionality for PySQLX-Engine.
The package is currently a work in progress and subject to significant change.
pysqlx-core will be a separate package, required by pysqlx-engine.
This package is written entirely in Rust and compiled as a Python library using PyO3 and PyO3-Asyncio.
This core is not so friendly, but maybe you want to use it, feel free to suggest improvements.
Supported databases
Supported Python versions
Supported operating systems
Example of installation:
PIP
$ pip install pysqlx-core
Poetry
$ poetry add pysqlx-core
Example of usage:
import pysqlx_core
import asyncio
async def main(sql):
# Create a connection
db = await pysqlx_core.new(uri="postgresql://postgres:postgrespw@localhost:49153")
# Create a table
await db.execute(sql="""
CREATE TABLE IF NOT EXISTS test (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL
);
"""
)
# Insert a row and return quantity rows affected
await db.execute(sql="INSERT INTO test (name) VALUES ('Carlos');")
# Select all rows, return a class PySQLXResult
result = await db.query(sql="SELECT * FROM test;")
# get first row
row = result.get_first() # Dict[str, Any]
# get all rows
rows = result.get_all() # List[Dict[str, Any]]
#return the db types to Pydantic BaseModel
types = result.get_model() # Dict[str, str]
# Select all rows, return how List[Dict[str, Any]]
rows = await db.query_as_list(sql="SELECT * FROM test;")
# close? no need 👌-> auto-close when finished programmer or go out of context..
asyncio.run(main())
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
pysqlx_core-0.1.34.tar.gz
(32.2 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.34-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b5bc5acdec121ea08796ee20b67704d2ed4c5a7f02cdf9ddb2e282c26d1aa54 |
|
MD5 | 3fe8cace97e9609ecc93c1a9bef71f69 |
|
BLAKE2b-256 | 599775ede89e98b7e23d86e6aeb9e781a9df2d358a3a28164a891d8394b28389 |
Close
Hashes for pysqlx_core-0.1.34-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f4f37e32973826d2ea568bbef13bf27c5add2251af939106cda2b77cca14535 |
|
MD5 | 20aa590c244be03d339531c6fa4dcbde |
|
BLAKE2b-256 | c5ce59318b8bff4d1267ee5d405e94649acd7b52b52163e965bd0e72ec967eec |
Close
Hashes for pysqlx_core-0.1.34-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e9336b986bbd2799d31726f9f4e3194ee1e90b2487f9a42d1caa21be5a6e361 |
|
MD5 | 0da21e3ed540142ec9d256d9b191a32f |
|
BLAKE2b-256 | b116504e3dc9dcf7a4f36554cd82537a391aea7a345a3a31c559bbb04346613b |
Close
Hashes for pysqlx_core-0.1.34-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6382c9ae701d3a292faa6e210d6f4b1d31a8630a6d101f6392ea33d7bc4cde5 |
|
MD5 | f4dda0647730c8c03e71fb80cd1e7f2e |
|
BLAKE2b-256 | 6d7248bead67dbf08183baacafc6f155ef06858e093bf74945defa51eb1e2ed0 |
Close
Hashes for pysqlx_core-0.1.34-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dae35edc9020828075e31554c6eacc6949c48d2ef4b27019b2880f0e548ba826 |
|
MD5 | d2dbe91279b8f1f7afb42aba89fdbf09 |
|
BLAKE2b-256 | 25bb884b38b1143105d5cd11498567e6632723f9412c3b2e67036bd4cc9a64d9 |
Close
Hashes for pysqlx_core-0.1.34-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3835e3695433ae7654295a9fb352422b4b17a4062d847ae388fb8428df1ffae |
|
MD5 | 0241d34cf01e6cde9e2b886eae54d80b |
|
BLAKE2b-256 | bbd5b9ee6ea4c0c5f48a43ca3753df7d4a41c6ea5ca62070c58305abc9659a7f |
Close
Hashes for pysqlx_core-0.1.34-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e1c9c718466276e72f0c9e403ef11583b7ece33a52eaff7f019da3f374788a0 |
|
MD5 | 31aa43eb3cce808f751a38bc8373d793 |
|
BLAKE2b-256 | 086ae6863fd5b9ac3e7025d1730b9be0d15a8b496e19ee180403a2d45332c21c |
Close
Hashes for pysqlx_core-0.1.34-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c6775c98066083258e98bf0c1f1b3ace66a25f14c7c20c5dc689c3d6b11f127 |
|
MD5 | caa50380bcc3f44937ccf58a3ff91607 |
|
BLAKE2b-256 | 12df5604ec19e34d1c61ba3b4ac54274c775366ab4bcbc1607a743bd9c86865b |
Close
Hashes for pysqlx_core-0.1.34-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f950a98bf2a86cd46c0ad36e6e6e0b34cda101038af503f6ba284dff74a505e4 |
|
MD5 | e2f3a01c1b46eaca4a44c182a3d1d9ee |
|
BLAKE2b-256 | e233e60244f5859b018fc9ca3dfb57028b00ce9d8dc4484f8541e7211fcfcfc0 |
Close
Hashes for pysqlx_core-0.1.34-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d53de19f977bfc72534ed8809f6375a5fd80fd51b669a7ca1530033d7f8a6c3a |
|
MD5 | 0f0822c75373ea7f6caacdd7022a108e |
|
BLAKE2b-256 | 65b571e6ce9477900cf01fa88615a57f5ad563c68bc92fa76e9eb802ad8c67da |
Close
Hashes for pysqlx_core-0.1.34-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 048b0ec5e223c3725b58fa51dae8c3f5674e2206ef755eb3dc2825f845c6aaf4 |
|
MD5 | 62acf01de230ac7c8a0a797505172f2b |
|
BLAKE2b-256 | 0c35531eb6a4ba74bb7aaf601cf75369e8d3ad3926dc2321f66d51f92504d482 |
Close
Hashes for pysqlx_core-0.1.34-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae37e4b88cff10c862417e06db33cfe154f7d69e00346099b242d0621ca87b4c |
|
MD5 | 1b723e700f073b6da98cf6c5951add16 |
|
BLAKE2b-256 | f2890c02c77074a0b298da689e227a427a2e463ad72742d8c3ffcfc2d885677c |
Close
Hashes for pysqlx_core-0.1.34-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7ab4f225d66aead00a8c162fe62f5409f7aab5ef5f733a82ffe9fad5f391a1a |
|
MD5 | f6f1fc6c6f50fd9fd6a1fe0cc029fb5a |
|
BLAKE2b-256 | 305d2c31446f96ef1385b80c8dd0cc82923363557a2f7b87b1ce57decd0d244a |
Close
Hashes for pysqlx_core-0.1.34-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dd3b9757b9a8ee451fc990a06fe11dfd57868f4718d22aa277743366aff4348 |
|
MD5 | 354be5ebd8da382ffc884351716219cf |
|
BLAKE2b-256 | 6ea7df2d2ccc447d9aa2d22d11d209c915c72920b46c14b60e6621b0f8a54509 |
Close
Hashes for pysqlx_core-0.1.34-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56fcd3ce29d2ba445016cf66b4232afba081c0c3abee043d9ea0b90a5f4d4125 |
|
MD5 | f89514c1bd70cd32bed4c8f2b2327e02 |
|
BLAKE2b-256 | 73b81fdbeb4fb12ec292bb36a373622b054c74f27db33863b327e1435ed5432d |
Close
Hashes for pysqlx_core-0.1.34-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36214d0778f2949276806c13bfe643cbaab58fe19dca3dd0d529f32704cba873 |
|
MD5 | b7df409a5ec04dc0aec0eb48ad60736b |
|
BLAKE2b-256 | a9b41b877a730bbef70c6495d799fa1b38edc7c1f5c707eca502cc1e67467a4f |