Skip to main content

A fast and async SQL database wrapper for Python, with support for MySQL, PostgreSQL, SQLite and MS SQL Server.

Project description

pysqlx-core

cargo ci pypi versions license downloads

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())

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.50.tar.gz (200.0 kB view hashes)

Uploaded Source

Built Distributions

pysqlx_core-0.1.50-cp312-none-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

pysqlx_core-0.1.50-cp312-none-win32.whl (3.6 MB view hashes)

Uploaded CPython 3.12 Windows x86

pysqlx_core-0.1.50-cp312-cp312-musllinux_1_1_x86_64.whl (6.0 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

pysqlx_core-0.1.50-cp312-cp312-musllinux_1_1_aarch64.whl (5.9 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ ARM64

pysqlx_core-0.1.50-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pysqlx_core-0.1.50-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (6.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

pysqlx_core-0.1.50-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

pysqlx_core-0.1.50-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (5.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

pysqlx_core-0.1.50-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARMv7l

pysqlx_core-0.1.50-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

pysqlx_core-0.1.50-cp312-cp312-macosx_11_0_arm64.whl (5.0 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pysqlx_core-0.1.50-cp312-cp312-macosx_10_7_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.12 macOS 10.7+ x86-64

pysqlx_core-0.1.50-cp311-none-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

pysqlx_core-0.1.50-cp311-none-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.11 Windows x86

pysqlx_core-0.1.50-cp311-cp311-musllinux_1_1_x86_64.whl (6.0 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

pysqlx_core-0.1.50-cp311-cp311-musllinux_1_1_aarch64.whl (5.9 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

pysqlx_core-0.1.50-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pysqlx_core-0.1.50-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (6.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

pysqlx_core-0.1.50-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

pysqlx_core-0.1.50-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (5.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

pysqlx_core-0.1.50-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

pysqlx_core-0.1.50-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

pysqlx_core-0.1.50-cp311-cp311-macosx_11_0_arm64.whl (5.0 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pysqlx_core-0.1.50-cp311-cp311-macosx_10_7_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

pysqlx_core-0.1.50-cp310-none-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

pysqlx_core-0.1.50-cp310-none-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.10 Windows x86

pysqlx_core-0.1.50-cp310-cp310-musllinux_1_1_x86_64.whl (6.0 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

pysqlx_core-0.1.50-cp310-cp310-musllinux_1_1_aarch64.whl (5.9 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ ARM64

pysqlx_core-0.1.50-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pysqlx_core-0.1.50-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl (6.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ s390x

pysqlx_core-0.1.50-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

pysqlx_core-0.1.50-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (5.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

pysqlx_core-0.1.50-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

pysqlx_core-0.1.50-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pysqlx_core-0.1.50-cp310-cp310-macosx_11_0_arm64.whl (5.0 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pysqlx_core-0.1.50-cp310-cp310-macosx_10_7_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

pysqlx_core-0.1.50-cp39-none-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pysqlx_core-0.1.50-cp39-none-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.9 Windows x86

pysqlx_core-0.1.50-cp39-cp39-musllinux_1_1_x86_64.whl (6.0 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pysqlx_core-0.1.50-cp39-cp39-musllinux_1_1_aarch64.whl (5.9 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ ARM64

pysqlx_core-0.1.50-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pysqlx_core-0.1.50-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl (6.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ s390x

pysqlx_core-0.1.50-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

pysqlx_core-0.1.50-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (5.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

pysqlx_core-0.1.50-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

pysqlx_core-0.1.50-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pysqlx_core-0.1.50-cp39-cp39-macosx_11_0_arm64.whl (5.0 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pysqlx_core-0.1.50-cp39-cp39-macosx_10_7_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

pysqlx_core-0.1.50-cp38-none-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pysqlx_core-0.1.50-cp38-none-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.8 Windows x86

pysqlx_core-0.1.50-cp38-cp38-musllinux_1_1_x86_64.whl (6.0 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

pysqlx_core-0.1.50-cp38-cp38-musllinux_1_1_aarch64.whl (5.9 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ ARM64

pysqlx_core-0.1.50-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pysqlx_core-0.1.50-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl (6.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ s390x

pysqlx_core-0.1.50-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

pysqlx_core-0.1.50-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (5.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

pysqlx_core-0.1.50-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

pysqlx_core-0.1.50-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

pysqlx_core-0.1.50-cp38-cp38-macosx_11_0_arm64.whl (5.0 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pysqlx_core-0.1.50-cp38-cp38-macosx_10_7_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

pysqlx_core-0.1.50-cp37-none-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

pysqlx_core-0.1.50-cp37-none-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.7 Windows x86

pysqlx_core-0.1.50-cp37-cp37m-musllinux_1_1_x86_64.whl (6.0 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

pysqlx_core-0.1.50-cp37-cp37m-musllinux_1_1_aarch64.whl (5.9 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ ARM64

pysqlx_core-0.1.50-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pysqlx_core-0.1.50-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl (6.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ s390x

pysqlx_core-0.1.50-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ppc64le

pysqlx_core-0.1.50-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (5.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

pysqlx_core-0.1.50-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARMv7l

pysqlx_core-0.1.50-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

pysqlx_core-0.1.50-cp37-cp37m-macosx_11_0_arm64.whl (5.0 MB view hashes)

Uploaded CPython 3.7m macOS 11.0+ ARM64

pysqlx_core-0.1.50-cp37-cp37m-macosx_10_7_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page