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.33.tar.gz
(32.2 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.33-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57dc52bd26c394f3df93bd61a882f27842e6ffa79b38e95ebe6edece1ea8a0be |
|
MD5 | d8f9bca4c2170fcc5183f274aa37627c |
|
BLAKE2b-256 | 285b5b5b13fd457686df8fd90c25243cccf415da839aa6f3192bcc79ab0fa1f5 |
Close
Hashes for pysqlx_core-0.1.33-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6821ad6dc0ed7d3f09b4f663763ea686890e048bfa4993f87f4e0c0c76ac5bf9 |
|
MD5 | ccec8086c969f14300af0c09d5377705 |
|
BLAKE2b-256 | 1088f6fde49d28d34785fa5671e54624f06a96538bc2c51e6f53cba8513e9a49 |
Close
Hashes for pysqlx_core-0.1.33-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d87f2ac3df83fc3cca6c33f19eac706c2cb9c5422bcee586f7247558de0397d |
|
MD5 | baa298019d7cf17e8ac06a40782b781f |
|
BLAKE2b-256 | 044acb734b253df23887d3cd9e9ec35616be63f2c769dbe859ab9e461907bf04 |
Close
Hashes for pysqlx_core-0.1.33-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ead7ae80463504a2ea33ed763d5026ae823f6fffaa5da56303c22ca88c04c79 |
|
MD5 | 2709c63ece0c5ad9853905935a328041 |
|
BLAKE2b-256 | f0aa59a6c9762a5c8da4013151aa5e41453a3384efcaa64624b37b02c02ad41a |
Close
Hashes for pysqlx_core-0.1.33-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd7f37026b6d23090916bccf9ffc0cd16af08a3da558d0b930eff4a23c929f4c |
|
MD5 | e8381df89ac8ef4abd6882100415d5a3 |
|
BLAKE2b-256 | ecfd4ff9aa2ad927ab72616269566246a3fb5e43e11142035056629f67bf11f5 |
Close
Hashes for pysqlx_core-0.1.33-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f108fe94f81ac21de51f592ef60dcd31e46137962a5afe27525120bad7cf19d4 |
|
MD5 | 2a94e1f46b7ef516c3c67812abd900cb |
|
BLAKE2b-256 | 2a762ebe26a5df47800f43a5a3c093141bc0263efb1a70ec644abf7b41a3417e |
Close
Hashes for pysqlx_core-0.1.33-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb207d3a9e7833ce056f7a7d8356e11ef72ef3980420c2b34380f8dc273a7f33 |
|
MD5 | 3850fef29708868e6fd7d34b95461489 |
|
BLAKE2b-256 | 392ba7b097ff3fbe77ce9684a7a64a7f1cdf22f69b16e0d1601d4a2c97c29996 |
Close
Hashes for pysqlx_core-0.1.33-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0d7381b9d3e6b32515cd76896d2a92b0ef994c9f8c0ffe7e6c7177f22259a51 |
|
MD5 | b7217690a459affc0c5b74051294fba1 |
|
BLAKE2b-256 | 18a21305d96583716b3db8bdbee11fefa3f70c14d88d01e8bcfde4d557352a7e |
Close
Hashes for pysqlx_core-0.1.33-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd81fa56981aef04affb6486c37818a41e03bc8a931e9336e831628ea2510c74 |
|
MD5 | 1ce2bbe9c3894d2d212d6d4939e73ac2 |
|
BLAKE2b-256 | 4742a0af5e984c048073d4f28119d28167b35836ae548c7d04592bdf4bff8abc |
Close
Hashes for pysqlx_core-0.1.33-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a01e24fb03d4840f3a914e6ce4365d63f26ecf3d5845700315dcdfa6fd32fe6c |
|
MD5 | 62e793fa6e304ed840f08a2f4d1cd8b1 |
|
BLAKE2b-256 | 7e13accda98918bee8b1353987b31c6410ad2d15437c207b83c741fef846e98a |
Close
Hashes for pysqlx_core-0.1.33-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dcefb50beddb943608bec3c6fe451411fd58d624d57be5df7da87bcb35e059a |
|
MD5 | afd5578eb066218a65a3494d7a896145 |
|
BLAKE2b-256 | e3ad377b21ef4dd0d3703779c27e6ffb614678a1ba7fb245c8f49cb6e59cb872 |
Close
Hashes for pysqlx_core-0.1.33-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab6b2842fc653e475884e01707983224e7e29d22235eaf242e375d8cf450e4a |
|
MD5 | 15a7e494abe64b5647cba8ea9a6ca864 |
|
BLAKE2b-256 | 8a6f904f3053852a6c0c142d41ac8ad7449faa4f0d898d7f5c5fcbbba272eb89 |
Close
Hashes for pysqlx_core-0.1.33-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdb5254ce2a01bc82fff548e34079bd014457bf72d1060b7f70cb56d1ff2f601 |
|
MD5 | 4a7d907f4ad9c65e891ccabca92e85c2 |
|
BLAKE2b-256 | f163a8c52196b7f29f0d109ac0e3d777e8cf091366e693527869baf04c72bc9a |
Close
Hashes for pysqlx_core-0.1.33-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e96c6a97575743fab39f649fdde2f4bd0190b09c0cd4d610557061cb9473a9 |
|
MD5 | 543c33e3f177c1d419307c363fe982fd |
|
BLAKE2b-256 | 2ff82fefec71428d121f0638df13953120e80575940d05aa8ed25e798b16a78b |
Close
Hashes for pysqlx_core-0.1.33-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99c1498a3c4a64c743c49ed6dc535403a6d1f5efdd026d5d97c95926458958d4 |
|
MD5 | 1c2691019a38dfaa83d85f4c376767f8 |
|
BLAKE2b-256 | df9cb414293304eee1bba62ade872f03f7fc17df58309e5b6c14f632c8ef774f |
Close
Hashes for pysqlx_core-0.1.33-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ef62e13d3429905be5e5fab86c8abf199c1b04a8c92d75161b5ec97c71151ef |
|
MD5 | 07e2490f2de091dd450716d2e07e684a |
|
BLAKE2b-256 | 307808f339174acee46899d10edb20080c1c1fde4726f728e5582bbf93423734 |