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.35.tar.gz
(32.4 kB
view hashes)
Built Distributions
Close
Hashes for pysqlx_core-0.1.35-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8a31efa6fe79d9ef6608bc59e6dce977aa589694d53437dc653e6c114e1334d |
|
MD5 | 977a6ad4433badcc5a4b3153ebffea46 |
|
BLAKE2b-256 | 701a9038ddeb27af4b2976405171056c2bff241658b7350087aab049aa5d732c |
Close
Hashes for pysqlx_core-0.1.35-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 917c1e69de41412fc6a6e70743f33b5d35ddc32b819e057094bb5e9d958ae9da |
|
MD5 | 337ce0c71684ae283095acfed77b7ca0 |
|
BLAKE2b-256 | e1dc05d205dce85157c0d8888f1d04395533e4afa0bd0fd845bdfe50b0dd105e |
Close
Hashes for pysqlx_core-0.1.35-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e1bd3aa2df555175f347cc333fdecd52510615ae8372a7ad7c540bf6bb2455 |
|
MD5 | e705e97ff61b3238cc2020b1c53078e4 |
|
BLAKE2b-256 | 607faa8c0f89dca3b1ce177c47b7d588773b6d2a1bc12ef8c0992e0d81fc8997 |
Close
Hashes for pysqlx_core-0.1.35-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b90e612dfafaa311fe3a73a390198df329747617fb64e54b81244ff30726ba7 |
|
MD5 | 0dda48ff81afecce0cba53526cd2261e |
|
BLAKE2b-256 | e06a9a282c92e72dc7e93982f6c9f5b3535337399451f6bed226d0d8333b9fb0 |
Close
Hashes for pysqlx_core-0.1.35-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90918caa595748f73ec17ac34d12e1088dd4f3531753cd84723ce663c9d8bd10 |
|
MD5 | 3fda12f87ea56944d070f68dc4dcc2d4 |
|
BLAKE2b-256 | 82796137cb1be63e3ac2c34022e8995fc2c7f5e90e189a569a9bb38f4ae897dc |
Close
Hashes for pysqlx_core-0.1.35-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ebe451ddb767238bea59f88d82ec79e514f5faa814ce3b69b27b7e5ceb104c2 |
|
MD5 | 1bc07838b253af41c2891c27e1faa09d |
|
BLAKE2b-256 | 020f22e4cfb1f53e5b8387c5803f347296da9aa54ce0cf60838690c88f889cee |
Close
Hashes for pysqlx_core-0.1.35-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce134b25dc9ac5c7e633b9c8c44ecd0a0ebcd1bdc1216a0c8119299ad7a212fd |
|
MD5 | 9ad6d539f8589c39f7daf39a6f375477 |
|
BLAKE2b-256 | fbb7528ac95d77dd6e741a5ba7fe3788a06cf116f6a2e127609ad96345d5fc6c |
Close
Hashes for pysqlx_core-0.1.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f96cb15e9c6490b19e082f01d0960d6f09ab7c97f9bc619cbbadbbdc1c998e |
|
MD5 | e0a6f2b490ad28c53a5ad39bdff271b7 |
|
BLAKE2b-256 | df90d96b3de1b0487fe1436245e7b13fb917af4c08836ecdda9361da13bb83e2 |
Close
Hashes for pysqlx_core-0.1.35-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09fdc91a8d0b681ccc479756540a02afcacc9b5520ed31fb192b6cbe91d7609b |
|
MD5 | 77f2684bbc12bfd759ae7395f5332321 |
|
BLAKE2b-256 | f4c71b66fb9fa742b0b3a388b77eef8737c49ce638aa1e94f546e76da6cf131b |
Close
Hashes for pysqlx_core-0.1.35-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a056cb5b680a18dcae55cbb6dc10568dbf78d75f0bd1249d2c0e05c5c722cfb |
|
MD5 | be01b427534843905f0ed24bc9c59908 |
|
BLAKE2b-256 | 2b05a4837352ac63376310f5b2907affc60f15da1239af336ce691494fdf06b5 |
Close
Hashes for pysqlx_core-0.1.35-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88687023f2b3c1bc12d05c21a3d3fc4050ba2feef15db462be2e9797fb13cd98 |
|
MD5 | 1ed9838e88fe7e33435611b1e9d569aa |
|
BLAKE2b-256 | 0e77c5dc9a4c2671f1a5a33f7a612fd34e3ede76290e04def7aac39f475f9b8a |
Close
Hashes for pysqlx_core-0.1.35-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f16dca8e14dd658f2840f8fc555a1d6162f9490d765f8a93f4bcb06b143af6f5 |
|
MD5 | 94762397cd7ecf451c19689772950689 |
|
BLAKE2b-256 | b1356d21d7ab2c41750d66424d604f1284e883b51e94b9f481df7ee6eee527c6 |
Close
Hashes for pysqlx_core-0.1.35-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e87378667060a53f9a7b342ae05c2a4ab4eda5d2ac994b6e673d6a8d349508b |
|
MD5 | df37bef56b2a376062b9d55f6d61ea31 |
|
BLAKE2b-256 | 2b7942b41078440bea505bc0c82554e6eb1c0bb7041c28c9d5c134c8d0cc6f9c |
Close
Hashes for pysqlx_core-0.1.35-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b722e8f307a9ebfee9198f0f5b142aa262fdf44147150079bbff2ee6b1e4a005 |
|
MD5 | a48345e934ce8b84ac6c4936f95b5fd6 |
|
BLAKE2b-256 | 50d894647aa63adf5db4c995d3fdd70ed21190db5fcd5e6d4e43267bb0431c09 |
Close
Hashes for pysqlx_core-0.1.35-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7698101afb7643405f9e374d43f0e0701ec0f6123adad3d45a22828de509314 |
|
MD5 | 38fdb5ee25931dd426fd903bb08a2f58 |
|
BLAKE2b-256 | e9f6dc419befc2e3e264769f231dae22d63a5a790c2ce2fac0c997dc5de1ce26 |
Close
Hashes for pysqlx_core-0.1.35-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f7272e23fd0dfdf6c93be5de4ade877504c656de70abfca471678160ed7a85 |
|
MD5 | 868f1dfd31b8b0773ac161dcc04b1fd5 |
|
BLAKE2b-256 | 5671121da099617e6fdff1555c90638d7f71b0fc775d19e9ab6776b6e490ee4e |