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.31.tar.gz
(32.2 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.31-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bad347ac34787b6c288786a3ee5fad48b0dd2d3b1b9d97302addc1de1f93b02 |
|
MD5 | 11209dd6937f8a8c16c8c9e6062e16a3 |
|
BLAKE2b-256 | bd52ca3ac2f86c8b49c41c57a12b91a94bb1ed7fcaa5866aade7941887279d20 |
Close
Hashes for pysqlx_core-0.1.31-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 468696018a7412f363ee4bbc6122273550e4008f16676dc68e7d02297226599e |
|
MD5 | c95435cfc5af47c8f4c0c24f6d3f0fa7 |
|
BLAKE2b-256 | bebb1b3d45fda93f72f2ff2f4774f3da16f42260d08ab57d3e2c70625054b888 |
Close
Hashes for pysqlx_core-0.1.31-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1cea882a7cae2b1baed4a55db8aa2127c77cd4755f9d7b7d67af562e3993c5e |
|
MD5 | 9cf88aadb648f21b16a0cfc658891c45 |
|
BLAKE2b-256 | 97e9328e253b7896503739cb9581eedf0fe4f002d9848e4ebdae355564705b2d |
Close
Hashes for pysqlx_core-0.1.31-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d125c56bbc8c19429796c0a5f4c9191e2c811615459fcb87c01f1b2c27562783 |
|
MD5 | 3df96e32dd5d6caa5863f55409ce3ac2 |
|
BLAKE2b-256 | 015e89ee9341eaa6a81a5b017298d22a9e028ec60768753d7a251a57f3c73868 |
Close
Hashes for pysqlx_core-0.1.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fcb14bc84bd25aacc302c0bc663eaa509fe91f3ec4d4612be5562f55fa23109 |
|
MD5 | 55150f03deaa34cf25fbb52d8cfd7bc6 |
|
BLAKE2b-256 | 8ae3986a52fb275f0e2d0b290a7fde59976fc8f3f9115a1c3909f0fb9ddcecbd |
Close
Hashes for pysqlx_core-0.1.31-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0801e9606f8e7dac24db920396715641279a158b6590367ee701e04cc502c8c8 |
|
MD5 | b631a05527bf7ba8e216c1c663738907 |
|
BLAKE2b-256 | 101b5f934170326bd4b4cc4ca8a1f1ac2538c805959d6a20ef06c55462a3396a |
Close
Hashes for pysqlx_core-0.1.31-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef71cbd9a726a0f5ced7add6cdde2a1d72d3a501d062b55e787644110756796a |
|
MD5 | 146de7243c3ab0330fe356f593b669ea |
|
BLAKE2b-256 | 0cef24d4fe9a63c90f9f491078e35fc0ebbbb501fe8708279bb3fa8e639af1dd |
Close
Hashes for pysqlx_core-0.1.31-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7c753adbf8c35f9656fea2b879d6e2bdc1045a8cab988b18cbb13500c25bcc |
|
MD5 | 13a86329bb83f97d231169a28e67c276 |
|
BLAKE2b-256 | 8117544091b4bad08335836ef80015f0cb4dcd0b5cf9ffc7e4a2071d11d58e85 |
Close
Hashes for pysqlx_core-0.1.31-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f6617803404632fcbb1bac274b166663f5eb047b190ff57dcf8e0aa052c6d6 |
|
MD5 | 1e3ba5db5ae47c4fe840352a2baf846e |
|
BLAKE2b-256 | 00e39bb7d9f5377134041f342015b97c4b7522825e9774ac480d0e0e5f2677a8 |
Close
Hashes for pysqlx_core-0.1.31-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8ad0d86b8bdfe7eb3fb46ebe32f2c1d383502f469ed0c909563dbda5194b5f0 |
|
MD5 | d7aa466052a4e591b6dcadf76363b568 |
|
BLAKE2b-256 | 72fe98aca02aae330081ff496c1601f4ec2a8ae8baffe0d2fc3b8932d13aed05 |
Close
Hashes for pysqlx_core-0.1.31-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0fe84e28ba29634f8d029b1b0290c74d388397e1c1d6ca9aedf89b9bcaf914 |
|
MD5 | a141ece3569f6ff0f82754f1fc95eefb |
|
BLAKE2b-256 | d8eb5cd5d9e8b394d1e0ff2e3fa630d7d11f197bb06b162e6c7e6495048ccdfb |
Close
Hashes for pysqlx_core-0.1.31-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f3840f5f6e971a2ef72f35d1985ec40a48e721d1312315daea1d2b541938728 |
|
MD5 | a8b7ab54727140daa7f5409d11411c00 |
|
BLAKE2b-256 | ec3212ccb7f3f91e9132c4de58bfe6134d75cf026cc9fa8ae23f6807cf7e2b3c |
Close
Hashes for pysqlx_core-0.1.31-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e601f2d2ffbb94af543008c5f2bc442c2ab57a92bcbe5e04f9bcdb38f6a73ba |
|
MD5 | 72c359d7e418439fb087eab89d298ced |
|
BLAKE2b-256 | 2fb6ae3d84c28ae7638d7d7af930f9f7ccaca3f7efd86e1462d12340216e9328 |
Close
Hashes for pysqlx_core-0.1.31-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df28a58f3500a3764acb87e3ba321c37f8c647e71fa9d49fe30ae9148496c738 |
|
MD5 | 57207c5f819678a4cc1ff175ce300ec6 |
|
BLAKE2b-256 | ccaa0c1e7e83ccdd92bbf34ca2cefb91379024ab72daa95549aa6d3739f04543 |
Close
Hashes for pysqlx_core-0.1.31-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a56d5c91917285dc4c3d8efb4e40fc996517e9361b41ca422de267348204fd54 |
|
MD5 | c550df4bf428a9b884743414a5a732ee |
|
BLAKE2b-256 | 35e8272c7d5f59ea0243d1953b5435f20e2a7b3c4b6e5fb517753a8e6036e4ae |
Close
Hashes for pysqlx_core-0.1.31-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2b525660a1e3abe48f1b1006efa90a5dbfa3d2709415f858c587776ab8c37c8 |
|
MD5 | 8ea2799bc52065c7ae16f91d89f7dbcd |
|
BLAKE2b-256 | 74ab812c088d4f51d23dce8e2cea277e86a66a636a74f8d83e8c69bd92a26f54 |