Async and Sync SQL Engine for Python, with support for MySQL, PostgreSQL, SQLite and MSSQL Server.
Project description
PySQLXEngine
PySQLXEngine, a 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 only 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
PIP
$ pip install pysqlx-engine
Poetry
$ poetry add pysqlx-engine
Async Example
- Create
main.py
file.
import asyncio
from pysqlx_engine import PySQLXEngine
uri = "sqlite:./db.db"
db = PySQLXEngine(uri=uri)
async def main():
await db.connect()
rows = await db.query(sql="select 1 as number")
print(rows)
asyncio.run(main())
Sync Example
- Create
main.py
file.
from pysqlx_engine import PySQLXEngineSync
uri = "sqlite:./db.db"
db = PySQLXEngineSync(uri=uri)
def main():
db.connect()
rows = db.query(sql="select 1 as number")
print(rows)
main()
- Run it
$ python3 main.py
[BaseRow(number=1)]
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
Built Distribution
Hashes for pysqlx_engine-0.2.0b6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc468839c6474f969b02387a98e8f3e2e8db13a4de8ac1fdbdfe7f28fa21bb3b |
|
MD5 | ec05b38e19f97a6ad008049127fa6140 |
|
BLAKE2b-256 | 880e840478deb6a548b9a9a71ceef9f0d8237848e4b64a14333540ae0bc70bad |