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.32.tar.gz
(32.2 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.32-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ec5d41955e868c78416d2ef58dcaf82f5814d3e4b7394795006b5feb4f2646a |
|
MD5 | 84bb47b9b1b1366b8436757863d8cbf8 |
|
BLAKE2b-256 | 52a4ea59a74499e6dbe9f89581f8e003e0ca783006f9761f4d856a8b794c067b |
Close
Hashes for pysqlx_core-0.1.32-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dadacf48c118f57916d6b60eed0bf1a68cca676ed357c144d08782cf1cf2c670 |
|
MD5 | 3d34f135e04c620c082de98e23607dbe |
|
BLAKE2b-256 | 9e6133b3113295e637e103c9f5172ec3b140a3992e7c18c9d425ece07317d633 |
Close
Hashes for pysqlx_core-0.1.32-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b02d29c6f208cd1a54cc141bbcd0613560930f3e6bba3f2607b4ee9b75c053b |
|
MD5 | 7d871c54fac9957809304413d8012c44 |
|
BLAKE2b-256 | 11682ea4215f2b259362db6adb73dd38d935e785afb6b10f3912d82c26b97500 |
Close
Hashes for pysqlx_core-0.1.32-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | add3123164ed42a4a898aa6a07f1c528572d341931bc9cb5e031333c59317be5 |
|
MD5 | 4e512ac872e669f1bf5aa69f7be32cf6 |
|
BLAKE2b-256 | 7a7e957f4618b00d1749daeed224b15735d4c7214019877b80cfc14ad6234245 |
Close
Hashes for pysqlx_core-0.1.32-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18ef96e2aa52d41ac2e9a71602dc0688e504274a72d379f005491cc939be155e |
|
MD5 | f754164c0da6780e24e75ffac81f7fbf |
|
BLAKE2b-256 | ac6ba9f4d8f4ca14ca6d96c60a657f39ede2038f5aca184acf3ac5e46c1dc57b |
Close
Hashes for pysqlx_core-0.1.32-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 999f65a74982c17d28d04a7f49316f34ac043c0e59070f1580c3fcd666fbde58 |
|
MD5 | 3312677f1d76d3bf1f0248857bee2264 |
|
BLAKE2b-256 | 7cda9f93bd2d4a854701813a7d0c776330a0bb0995152e69b7930ce99f48e77e |
Close
Hashes for pysqlx_core-0.1.32-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08f7c4c66a7d6d802a3fcac78da27adddc47338364c2898b1d368cdaec490000 |
|
MD5 | b2ae3b8436758e3ef40a5fcfc0b5b047 |
|
BLAKE2b-256 | c46516ca4a49ad8d73d53af34839c769958684c51642ecb99dc15757cc1e1b64 |
Close
Hashes for pysqlx_core-0.1.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e73f55a0016f4762782049f552d03a24266b02231d3620e304d008a7e384421a |
|
MD5 | dc90d24a014e39ed15a0129c68596083 |
|
BLAKE2b-256 | f7deccb1a2c78047769fd17788b14afe9a275f2799022b04dc0bf4d9a4649cc1 |
Close
Hashes for pysqlx_core-0.1.32-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a465be95318f493090394e4bebc5641a105334589f77fbc9cc3dfb7768bf6e0 |
|
MD5 | 23c4ec7330e92aafc0da095d1a3645f4 |
|
BLAKE2b-256 | 475344be59c4dd264838a0f4bedbd970e22cf3e0e9e8792f12954a8aaeb2877f |
Close
Hashes for pysqlx_core-0.1.32-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9044397978178d3518ec9e3616e135332be8baa310982f05825fddf69e4611b4 |
|
MD5 | 8464fcbdb40afc5551702351627d785b |
|
BLAKE2b-256 | 77a6607168e588a1ee19928f05dd90da3d5e5ce30baafe063db9cc93a5f4bad1 |
Close
Hashes for pysqlx_core-0.1.32-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae1f6aa687dfa5c85000dee3093a1fbeac3a7d20cbd2a3c1fc520a757753437a |
|
MD5 | ab470452b49ca3691915003c5eb8ffe3 |
|
BLAKE2b-256 | f5fd322775903a263e9d05d726958c531f2c96b1f9976d7f452dd99355afd5f2 |
Close
Hashes for pysqlx_core-0.1.32-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a07270818f2dfcc8dba9b8f8db896c217cd3fe3443eb4f6f93255217745a5f7 |
|
MD5 | 824ca592ab3ff0917553189b664561f2 |
|
BLAKE2b-256 | d9ff81e68084c87ef4ffc566ddf7abe99d2b1bc3dcf0f37e9ac879cac164df37 |
Close
Hashes for pysqlx_core-0.1.32-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcbd4e2ce57e8eb7db15be04042659a5a3892f59419b45fa609eb16bd04e07be |
|
MD5 | 8508a5695a58ca3ae360d065c1de5aae |
|
BLAKE2b-256 | 1f361527772a24d5c157b2a4bc79acdd1a0e410c26d7e5192843fcf017e54d73 |
Close
Hashes for pysqlx_core-0.1.32-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50c15dfef255c40ee2ce73f1374ad3855d0f991aaf3b9c5d94697bbc2b407c01 |
|
MD5 | 3c0d081dc642f58946d2491bedda55cf |
|
BLAKE2b-256 | 86bea2cdb5d074956d611947830cf19aa954987320f813fd1f5c9236f9d8a9f6 |
Close
Hashes for pysqlx_core-0.1.32-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f39ad4f76e3a45bf08debe790ff4b844e20d587b7640382aa26e3d770fc1896c |
|
MD5 | 9906eee9f43032ec6fa9645e496e60ad |
|
BLAKE2b-256 | ef8ae4feeee8a3e9366ffff37aab241bdcebf5041bf5b752112b72807fbf9ec5 |
Close
Hashes for pysqlx_core-0.1.32-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c650417ae0fc87fb6a5640652ac01bfa309d8e422d280e5e6d73689d8aade266 |
|
MD5 | 7911e31398aeabc5fe49014a1a7eb317 |
|
BLAKE2b-256 | 136bd46d5de01984496ca728d8c3ccff82d5c741205ba3487f11a13e13fd6aef |