PySQLXEngine
PySQLXEngine, a fast and minimalist SQL engine
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:
SQLitePostgreSQLMySQLMicrosoft SQL Server
OS Support:
LinuxMacOSWindows
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)
]
Metadata
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)
| File | Size | Uploaded | |
|---|---|---|---|
| pysqlx_engine-0.3.2.tar.gz | 26.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|