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.30.tar.gz
(32.2 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.30-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cded24035bc65ef6552d5220e269c43b3c74dc435a8f0bf9d5ba153e8548bc1 |
|
MD5 | 118402cbe9e54126d40c4ef39dc17faa |
|
BLAKE2b-256 | 09be37fd60fbf8a4fad82f41665e6e272b756e800f0ffc8ac422913b95708e18 |
Close
Hashes for pysqlx_core-0.1.30-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c2a11f09d16b18a3409f7ccf59bf99795095ceab8735c4fbe828b237b1d672 |
|
MD5 | b064794dcfd6595a970dd18fe918455b |
|
BLAKE2b-256 | 95434c2396e60fbb8a9528c1a5d271e2ad1d978d2b0f84bfa53da5c0cad255e3 |
Close
Hashes for pysqlx_core-0.1.30-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2167cacd0a08ac861599cc5ec1ae059f8bb0c0931aa8237d113c8765add843af |
|
MD5 | 6197e1e90530b844f0f63ca0aa68f5a1 |
|
BLAKE2b-256 | 22945025751e2fddf03c5eb02194f78b4f4873af3a3b1a4762c9446f8e9a1c85 |
Close
Hashes for pysqlx_core-0.1.30-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa49c3e8381e323c03d2f3be82bbeb22e40a08b1eb9e337675803832ed8adb05 |
|
MD5 | 0a354f75dea7de4a9701b91701b3b587 |
|
BLAKE2b-256 | 2380277f1a27703b72dfbee58e98b31e28177f6116d876d05e06334bc6cc8268 |
Close
Hashes for pysqlx_core-0.1.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee284674678eddabc96bfe24c16eb7f7e6af29712a00d25121ededcb7e5bfca9 |
|
MD5 | 87aa859c9e757c173b12ab6c043d5b4c |
|
BLAKE2b-256 | d73a506339787dfbb8c671e1ae0923e2e0195e9544fc1daad518ad1bbd2cfd12 |
Close
Hashes for pysqlx_core-0.1.30-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e79347854010236e70decd91f22e6491323274f619376ce436d71f4790a147 |
|
MD5 | 7b396caa2e5ab30cf4946d06a8bfe38e |
|
BLAKE2b-256 | 71e4bd9f889088115283d029ade1ac2c8b7f74a1df2a92b23e95c2bf4f1167f2 |
Close
Hashes for pysqlx_core-0.1.30-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdc704736acb6da9a0e33f4fb72da9d262b49fc56b5d2c61a75cc4d6dca64f19 |
|
MD5 | a7bc9a72b8aaa3fcef611eb3374c13fe |
|
BLAKE2b-256 | 987c88a67ef8111f523e530cdb12650e71946befaabb216a1230d7b532a36c2e |
Close
Hashes for pysqlx_core-0.1.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6176af22d3c845569df0fe2773a7a1b5060c56fc40408a19b6517f0c2abc1233 |
|
MD5 | e3e63f40cf6db059354631914e95e0a4 |
|
BLAKE2b-256 | d12ce12c56f0a6473a95225f166f86e1573704777a535dd4cfece9367b06caff |
Close
Hashes for pysqlx_core-0.1.30-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdf9e3e9af2a5967882780bf489615572d396c6d3526dbbff0a4121ead0cb846 |
|
MD5 | 6db6e2845d20f2e6cd7753b6805e93bd |
|
BLAKE2b-256 | 1bd7a2054def19a0e828bc413aa73a8423bd190487b0fe5bd94bcf2fba78b8f6 |
Close
Hashes for pysqlx_core-0.1.30-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 989988d2a698993ef891e49fc66645f5ce0d1af6e9749b60c59a856885cb3f6e |
|
MD5 | 4436f52864bdd27f37735be2f2de8979 |
|
BLAKE2b-256 | 8a0c8888ae0cf5ede795b49121b657f8a70d665a6b4f8065b0604a290e1d84ae |
Close
Hashes for pysqlx_core-0.1.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8832062183e8d7ff51fe1605ba73066a8c4cf0a7c10a277b14d307a7742a2ecf |
|
MD5 | 5c8cd02270b31f973b685998795d7cbb |
|
BLAKE2b-256 | 57c66d7f49fa92525a5654a66ff37523a941a2771d0a1ebdbb022fbcba248717 |
Close
Hashes for pysqlx_core-0.1.30-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec616378d947f13177d7bf8f707553eb4c01c4bbb1f49cc1646dce693a669ba6 |
|
MD5 | c9d79b41964fc462b84d9402b5ca3059 |
|
BLAKE2b-256 | aec18aca0cc440d311ed68ebfdfc6e7155304b8f98e4020df72b8fea72ac0cca |
Close
Hashes for pysqlx_core-0.1.30-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43c45d19c0c87aef9597f4e280223b276305e643e3d450d160f42b11b71f4e65 |
|
MD5 | 5f1ca41d9d081de984f1ecc85190c980 |
|
BLAKE2b-256 | d44db025399f50d690d7752fca4c5569d94f5252ece336d6cac517ef97dd3814 |
Close
Hashes for pysqlx_core-0.1.30-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2ed6ad228e55f16e7d6a1b1e7520294f4f0ec918766063bf32b2042c4fdcb91 |
|
MD5 | 6371592c9eba5603b693661d4212a3fb |
|
BLAKE2b-256 | eba6d44a7e267bd61301a5b78072fbbebc81aed3157ca1c9a29aaf9b773847c4 |
Close
Hashes for pysqlx_core-0.1.30-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29716eddaed7456364afa885b3cccbe7d2989c82839f512cf06b9a6c279a3572 |
|
MD5 | 0144eaa0057bcc8352a4e506f2a0e4af |
|
BLAKE2b-256 | ae295e0e3558d738509b332543c2e54ccbe3ce3fe964e5abf257f93c1989aa48 |
Close
Hashes for pysqlx_core-0.1.30-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 194467d5543011919c2959405f41b4d63a9033d9150e1bd1f3a43fd61b69012a |
|
MD5 | 724aea454f93df6f8ea67dbbaca185c8 |
|
BLAKE2b-256 | 24e8eb1a70efe3eac26cab1d1f04db93047bf78a7bbf8274c030fff4ccdff954 |