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.36.tar.gz
(32.6 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.36-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 815c0d5ab08b49b6debb3bbee4d5897bef795ff948a6f4a9b9c4ac2729df0378 |
|
MD5 | 7db1e2a267e137ab3028255f9d75ed79 |
|
BLAKE2b-256 | 13b26dd1f097eb6737ad1b6deb934c548387d521f1713d94d3145915a24c8a23 |
Close
Hashes for pysqlx_core-0.1.36-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32b3a58f78b24b6ece91292228d5443c8d70f7bac97b570b5005146108e8824f |
|
MD5 | f091103eda596eee46da6a63191d9f8d |
|
BLAKE2b-256 | 07635019edd6185ce8f083dc98ea4c7e998bfe73b271f1cb4822809273f524a8 |
Close
Hashes for pysqlx_core-0.1.36-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19e6d0e553eb0bf6bd27c9e64c473edc2ebfae8577085b56db0196e40bc522b9 |
|
MD5 | da0c6d1a29f5e8ae86abdea425e0d072 |
|
BLAKE2b-256 | 056ce7a3390a49d29aa1adb77b985df110bcb030d8f71b34b8e0b5dc54feb55c |
Close
Hashes for pysqlx_core-0.1.36-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ab4faa166746a450948639e919060c793c8a2edff5ef3c7f83ffab11b1b90b9 |
|
MD5 | bf521c8888b0a972d495226fa791051a |
|
BLAKE2b-256 | 97455e7b51e4dcb2d61087e5c7b3554edc41eca5a8b6a7133b9aa902da429233 |
Close
Hashes for pysqlx_core-0.1.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff0a2efaa4f5c246fb0ba6a32367b1fa057f689c74490f626465ec181720144 |
|
MD5 | b4edb5ce7447c2968bf01a32c70b6353 |
|
BLAKE2b-256 | a2ba9d22d51836cdcdd7c64662a81c8b22b5d477659a60fa80e16a7ea782dbff |
Close
Hashes for pysqlx_core-0.1.36-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43f9b844433763c6b610970a72f4791cceb2d7dd8bb86c1247f9e521e75b53ac |
|
MD5 | 711715335954ef886bc60b156bf3f2d7 |
|
BLAKE2b-256 | e89cfbb2227e41c6635a06e07c825c8856cf345936d9e69ff52c9dc7209d7ef4 |
Close
Hashes for pysqlx_core-0.1.36-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 617d8e3c10f3f28b913b1dc848333db227174993157e32194975c3d7903084d0 |
|
MD5 | f78739ab8db850041b5b3786cbcf3dd6 |
|
BLAKE2b-256 | cb817dffbf13251d4d138a071ec3c5631bab7f02a9eacd71ba18dbbcb0f6b64c |
Close
Hashes for pysqlx_core-0.1.36-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e4f1cfc6fcd4e5abb1b9cbc1002be63c8a5df97e9ef9bb062d1945abb0afbcd |
|
MD5 | 3f3ca78967b4137d4b84be290415dc97 |
|
BLAKE2b-256 | 202978cd4b5c7d4c68c84a0b9e9d95d10032857e069e073e8bbe605579aed4db |
Close
Hashes for pysqlx_core-0.1.36-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7c1285e7276986638db3a2300249b9b2b1fe3a3f03d6049e16f7b0a2818ad3e |
|
MD5 | 64a37d398e861b48c14a7438aaa6e231 |
|
BLAKE2b-256 | 029310388280ff0a6207bc364e428eb231a841d966466a11989d7a894340b3ef |
Close
Hashes for pysqlx_core-0.1.36-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa3cd7c83f854b3507f0e28deb0e70f27da382779df5f6e094248d9faadeaae1 |
|
MD5 | 297a80f32d25c1ce850df52d628d6ce1 |
|
BLAKE2b-256 | c1f82786a4ca77d66f05a5f06d26a6f17673a361ebc990a30d915c6aa2d1da46 |
Close
Hashes for pysqlx_core-0.1.36-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6468c5b2d2fc9f0593bb9328f940f65bb0aa54df439961c9fca234f2dd41a914 |
|
MD5 | 458608e80f6e46ce89e32efeb320baed |
|
BLAKE2b-256 | 3d0dd4feec1facea0a5e41def51577ac3cedfa5859b53b3cfa71af85a1d935e7 |
Close
Hashes for pysqlx_core-0.1.36-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 720ab522a791bd0c314ec32fd5d4272982566c9881a4e1cf190f2c1a2dce85a5 |
|
MD5 | 377c1fedd851fb8ebc44bacdff5c6c5b |
|
BLAKE2b-256 | 09f4b1d2b7538143d03400e8ebfd0ec3128fc4de84a7c12dc899eb48ef14a257 |
Close
Hashes for pysqlx_core-0.1.36-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5dbd3915dc15aa16ea94bbd6de118bbaf9591dfb5bb71a405e3553919b67c90 |
|
MD5 | 0c439f1bbb3e5dc5810b1b186fe90fc6 |
|
BLAKE2b-256 | be37db2aaa84b0fe9852e4d80db91fc041d1605c97ed200538e2d339d1962b6e |
Close
Hashes for pysqlx_core-0.1.36-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 571725c8458a75f3ad35e87f4a5f418e76e84d6ef5fe5038f218b600f1e1d075 |
|
MD5 | 1323eb82e278b3ff8288b1ce24bdb71a |
|
BLAKE2b-256 | 3d758d74e7b1722c7f01942f36e1893ee03a4d91162188bbe292b31a60378843 |
Close
Hashes for pysqlx_core-0.1.36-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7923df0705e5cef31120b0ee6b22f47826ff334867dc6ee6d56c52e38970547f |
|
MD5 | 2ebbe35800f0e867ada2d8e416f75179 |
|
BLAKE2b-256 | 0e9e9d76d9fba659768dfc643fde55dbeadd41cfab9c0874b6ff83e36e5bb692 |
Close
Hashes for pysqlx_core-0.1.36-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5964470f19588b58eb9dda4fd81581c94e29f485474be003f1b551bc8cacb0a |
|
MD5 | a572f2457d3373004416b0b4652888bb |
|
BLAKE2b-256 | 872f48a831949a215fa13ca5b439eba74c2ed4af37736454770d461d80329e70 |