Skip to main content

PySQLXEngine

PySQLXEngine Logo

PySQLXEngine, a fast and minimalist SQL engine

CI Coverage Package version Supported Python versions Downloads


Documentation: https://carlos-rian.github.io/pysqlx-engine/

Source Code: https://github.com/carlos-rian/pysqlx-engine


PySQLXEngine supports the option of sending raw sql to your database.

The PySQLXEngine is a minimalist Async and Sync SQL engine. Currently this lib have supports async and sync programming.

The PySQLXEngine was created and thought to be minimalistic, but very efficient. The core is write in Rust, making communication between database and Python more efficient.

Database Support:

  • SQLite
  • PostgreSQL
  • MySQL
  • Microsoft SQL Server

OS Support:

  • Linux
  • MacOS
  • Windows

Installation

UV

$ uv add pysqlx-engine

PIP

$ pip install pysqlx-engine

Poetry

$ poetry add pysqlx-engine

Async Example

Create a main.py file and add the code examples below.

from pysqlx_engine import PySQLXEngine

async def main():
    db = PySQLXEngine(uri="sqlite:./db.db")
    await db.connect()

    await db.execute(sql="""
        CREATE TABLE IF NOT EXISTS users (
            id INTEGER PRIMARY KEY, 
            name TEXT, 
            age INT
        )
    """)
    await db.execute(sql="INSERT INTO users (name, age) VALUES ('Rian', '28')")
    await db.execute(sql="INSERT INTO users (name, age) VALUES ('Carlos', '29')")

    rows = await db.query(sql="SELECT * FROM users")

    print(rows)

import asyncio
asyncio.run(main())

Sync Example

Create a main.py file and add the code examples below.

from pysqlx_engine import PySQLXEngineSync

def main():
    db = PySQLXEngineSync(uri="sqlite:./db.db")
    db.connect()

    db.execute(sql="""
        CREATE TABLE IF NOT EXISTS users (
            id INTEGER PRIMARY KEY, 
            name TEXT, 
            age INT
        )
    """)
    db.execute(sql="INSERT INTO users (name, age) VALUES ('Rian', '28')")
    db.execute(sql="INSERT INTO users (name, age) VALUES ('Carlos', '29')")

    rows = db.query(sql="SELECT * FROM users")

    print(rows)

# running the code
main()

Running the code using the terminal

$ python3 main.py

Output

[
    BaseRow(id=1, name='Rian', age=28),  
    BaseRow(id=2, name='Carlos', age=29)
]

Release files for pysqlx-engine 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysqlx-engine 0.3.2
File Size Uploaded
pysqlx_engine-0.3.2.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysqlx-engine 0.3.2
File Interpreter ABI Platform
pysqlx_engine-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 59.6 kB

Release files / pysqlx_engine-0.3.2.tar.gz

Download URL pysqlx_engine-0.3.2.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
37f71533f1d8632edeba00f559243008214dd36bb28bc707d25132a1d1768a41
BLAKE2b-256 checksum
How to use checksums
079f3f7cdfe3be12c1640e47da65d9969cfb3c47130c8f85a02c2b18224df4d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.2 Linux/6.5.0-1025-azure

Release files / pysqlx_engine-0.3.2-py3-none-any.whl

Download URL pysqlx_engine-0.3.2-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5740a09ea821a39949bf8075fdd99b790816a24e9c033ff1622aade9f114116
BLAKE2b-256 checksum
How to use checksums
2cb16a069602c7285e28b878a78e716b42e8d59470e34ee19e17ff1666aa46d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.2 Linux/6.5.0-1025-azure

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.29

2 release files

0.2.28

2 release files

0.2.27

2 release files

0.2.26

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.21

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.17

2 release files

0.2.14

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page