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.38.tar.gz
(32.3 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.38-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43f0375b52cc89aff8a8003953abdc022ef3cd8563a4414a864ac12ca617ce9f |
|
MD5 | 0e1fd4c36fd3507db28db43c4ff7f5a4 |
|
BLAKE2b-256 | 92d27dacb4ccbf9704c94a9c1955cf165237414730581a72d97549aae2fd759f |
Close
Hashes for pysqlx_core-0.1.38-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed77d89ef9df3d09408899374e1e2d4f9730d850707653f9727bd80704d7080c |
|
MD5 | 1647f98618da476ccdd5e1e1c2ef3241 |
|
BLAKE2b-256 | f1d2554dcaff82a0c6d9643f08d0776a34716a9af0d6125d2ca6b0b85073bfc8 |
Close
Hashes for pysqlx_core-0.1.38-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1180c84184e1342dc186f528514c297b4a41b26f858ff607bdcecf3a16252a1d |
|
MD5 | d94c3125d5a5e8c0fad11cb3078fe043 |
|
BLAKE2b-256 | c8add6e657d689a16a12738d032d51a4c0b555f3cee1df24e2742aff6a4ce43c |
Close
Hashes for pysqlx_core-0.1.38-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d368fc783e6dc551c1ddda13360af2bff464d9e9f34b76c2f1317371fe86436 |
|
MD5 | 8b97ea7ed9724edf642cf7473bb27ebf |
|
BLAKE2b-256 | b82792bee1d4cd4341b77f1a0134a73e5f80c18e47b659e0ee508d90957e361d |
Close
Hashes for pysqlx_core-0.1.38-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85325e0075591233c3787cb57e9e9fddcabeea65934d016b4b63ed7119a80cb5 |
|
MD5 | f834e57d680b3f7cd44aefd01555788e |
|
BLAKE2b-256 | 689367ddfae1c8b46670334b67875a33969d57929c0dbe438228334cd1a38f8c |
Close
Hashes for pysqlx_core-0.1.38-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f00118c5a9d92ca6478b77ee7158d9508230d373716eb57130c57f13e2295f |
|
MD5 | e34935b2211011c72a5009afdde9bd4d |
|
BLAKE2b-256 | 8a141adfee458342b30718d95d36a274a79c313c7ac7517302ba3b5091644e05 |
Close
Hashes for pysqlx_core-0.1.38-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ebff4baa213e3103ad3c4a51393ce3b975fafbb8e7ba8d5dfa784938e18b94d |
|
MD5 | fccd7d7c417fc001cd9270bbc27b0634 |
|
BLAKE2b-256 | 36fb45e16627897006cc994d7c757a65a2d77812b3155f051a489d1e863c877d |
Close
Hashes for pysqlx_core-0.1.38-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9a6087a527231e6b4c1e1de56a91cce1dee0d940528d0c8f1680b245b63f4d1 |
|
MD5 | 910aa779d2ae2afa5c62261db8192c37 |
|
BLAKE2b-256 | 45f8a5ba5c3afeda88b364e6b9db90a07aa0b04f1a7e8a21a3264c07bc4ea888 |
Close
Hashes for pysqlx_core-0.1.38-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fda9965fa53acbf444760d297944d30c5be18474095f9d001d3b2584df58c891 |
|
MD5 | 275d49dd80191dcca6d9021fa7fe30ed |
|
BLAKE2b-256 | 0e7ce266dd7b79b0c535709dc806971018e35f30e7ef858dc0e4c38269fe59dd |
Close
Hashes for pysqlx_core-0.1.38-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df860c5a6a96711ddc6fb282157d3b5975e55c2a72694ee2256e25576f7b0b7b |
|
MD5 | ea75d9f20811923f354dab20f299fcae |
|
BLAKE2b-256 | 2070ba87c3c86230cb2e0b02d4b90293def8cac823ca99829c98f8f1cfd1a155 |
Close
Hashes for pysqlx_core-0.1.38-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8845905740b2a696519f654cf03703c0b68da3ffc9f4fa77c8d4e9a408632c9 |
|
MD5 | 4311d3f2cebc071a2a5922fcdd75eff8 |
|
BLAKE2b-256 | 6db8de4b1bb87fd3c7b12a42e06e8ac4eb319c869b798ca67c749d8e5858a9fd |
Close
Hashes for pysqlx_core-0.1.38-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f82971ee81094a102b8f0f7561fccf6ed92684b6cb5fc1a98273c1452caf6fae |
|
MD5 | 79cfb56217208908787c64ad044f09dd |
|
BLAKE2b-256 | 38deba46adf406270b1c6bcd530ed08e50dd6acba7c6f580cea94070af26af39 |
Close
Hashes for pysqlx_core-0.1.38-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e573a51d24f1288c6cf84dd195cc1ac2606cb3fcfd96c19add9d1143916d9a39 |
|
MD5 | 152c15d3b80191c7e3d4552f22bc31cd |
|
BLAKE2b-256 | f96853d56a28d1679c4608ba0f3e96fe7801ae425221c76283d120e9b18b4e80 |
Close
Hashes for pysqlx_core-0.1.38-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 383febbc5880d72bd510a972ad7922f583e8c2e69537d0c1d72991e2d0711c81 |
|
MD5 | 3b6f4b0ebf56211feff6e55d4a67dbff |
|
BLAKE2b-256 | 77231dc3d804abc05d7451ef233a58629e64c7025f5b61776d51d51a774204bb |
Close
Hashes for pysqlx_core-0.1.38-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aefeeac9120674b9b376c77f3b1fb683a9436ec17358812a9879943adf971ad9 |
|
MD5 | 6fb36b967e5a644a672b9544beac1684 |
|
BLAKE2b-256 | 7974cfd4c68f4b30767cc1664f34c139ffe7434e0e561cfd0d8d50e792395229 |
Close
Hashes for pysqlx_core-0.1.38-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e70a5abbd7ba979639369e7c27b1ab1ae4ccd0b1c59868cd02c87374ac9db191 |
|
MD5 | 00fedc49e4d08faab8a9659cad2c9218 |
|
BLAKE2b-256 | 79bb43fdc21b2f976b5889c21fe6b2e44e2b6516c295eee8cb2835517a2a90aa |