Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Async and Sync SQL Engine for Python, with support for PostgreSQL, MySQL, SQLite and Microsoft SQL Server.
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:
SQLite
PostgreSQL
MySQL
Microsoft SQL Server
OS Support:
Linux
MacOS
Windows
UV
$ uv add pysqlx-engine
PIP
$ pip install pysqlx-engine
Poetry
$ poetry add pysqlx-engine
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())
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)
]
FAQs
Async and Sync SQL Engine for Python, with support for PostgreSQL, MySQL, SQLite and Microsoft SQL Server.
We found that pysqlx-engine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.