# PySQLXEngine
<p align="center">
<a href="/"><img src="https://carlos-rian.github.io/pysqlx-engine/img/logo-text3.png" alt="PySQLXEngine Logo"></a>
</p>
<p align="center">
<em>PySQLXEngine, a fast and minimalist SQL engine</em>
</p>
<p align="center">
<a href="https://github.com/carlos-rian/pysqlx-engine/actions/workflows/ci.yml" target="_blank">
<img src="https://github.com/carlos-rian/pysqlx-engine/actions/workflows/ci.yml/badge.svg" alt="CI">
</a>
<a href="https://app.codecov.io/gh/carlos-rian/pysqlx-engine" target="_blank">
<img src="https://img.shields.io/codecov/c/github/carlos-rian/pysqlx-engine?color=%2334D058" alt="Coverage">
</a>
<a href="https://pypi.org/project/pysqlx-engine" target="_blank">
<img src="https://img.shields.io/pypi/v/pysqlx-engine?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://pypi.org/project/pysqlx-engine" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/pysqlx-engine.svg?color=%2334D058" alt="Supported Python versions">
</a>
<a href="https://pepy.tech/project/pysqlx-engine" target="_blank">
<img src="https://static.pepy.tech/personalized-badge/pysqlx-engine?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads" alt="Downloads">
</a>
</p>
---
**Documentation**: <a href="https://carlos-rian.github.io/pysqlx-engine/" target="_blank">https://carlos-rian.github.io/pysqlx-engine/</a>
**Source Code**: <a href="https://github.com/carlos-rian/pysqlx-engine" target="_blank">https://github.com/carlos-rian/pysqlx-engine</a>
---
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
```console
$ uv add pysqlx-engine
```
PIP
```console
$ pip install pysqlx-engine
```
Poetry
```console
$ poetry add pysqlx-engine
```
## Async Example
Create a `main.py` file and add the code examples below.
```python
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.
```python
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
```console
$ python3 main.py
```
Output
```python
[
BaseRow(id=1, name='Rian', age=28),
BaseRow(id=2, name='Carlos', age=29)
]
```
Raw data
{
"_id": null,
"home_page": "https://carlos-rian.github.io/pysqlx-engine",
"name": "pysqlx-engine",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "async, database, sql, engine, fastapi",
"author": "Carlos Rian",
"author_email": "crian.rian@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/07/9f/3f7cdfe3be12c1640e47da65d9969cfb3c47130c8f85a02c2b18224df4d2/pysqlx_engine-0.3.2.tar.gz",
"platform": null,
"description": "# PySQLXEngine\n\n<p align=\"center\">\n <a href=\"/\"><img src=\"https://carlos-rian.github.io/pysqlx-engine/img/logo-text3.png\" alt=\"PySQLXEngine Logo\"></a>\n</p>\n<p align=\"center\">\n <em>PySQLXEngine, a fast and minimalist SQL engine</em>\n</p>\n\n<p align=\"center\">\n<a href=\"https://github.com/carlos-rian/pysqlx-engine/actions/workflows/ci.yml\" target=\"_blank\">\n <img src=\"https://github.com/carlos-rian/pysqlx-engine/actions/workflows/ci.yml/badge.svg\" alt=\"CI\">\n</a>\n<a href=\"https://app.codecov.io/gh/carlos-rian/pysqlx-engine\" target=\"_blank\">\n <img src=\"https://img.shields.io/codecov/c/github/carlos-rian/pysqlx-engine?color=%2334D058\" alt=\"Coverage\">\n</a>\n<a href=\"https://pypi.org/project/pysqlx-engine\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/v/pysqlx-engine?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.org/project/pysqlx-engine\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/pyversions/pysqlx-engine.svg?color=%2334D058\" alt=\"Supported Python versions\">\n</a>\n<a href=\"https://pepy.tech/project/pysqlx-engine\" target=\"_blank\">\n <img src=\"https://static.pepy.tech/personalized-badge/pysqlx-engine?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads\" alt=\"Downloads\">\n</a>\n</p>\n\n\n---\n\n**Documentation**: <a href=\"https://carlos-rian.github.io/pysqlx-engine/\" target=\"_blank\">https://carlos-rian.github.io/pysqlx-engine/</a>\n\n**Source Code**: <a href=\"https://github.com/carlos-rian/pysqlx-engine\" target=\"_blank\">https://github.com/carlos-rian/pysqlx-engine</a>\n\n---\n\nPySQLXEngine supports the option of sending **raw sql** to your database.\n\nThe PySQLXEngine is a minimalist **Async and Sync** SQL engine. Currently this lib have supports *async and sync programming*.\n\nThe 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.\n\n\nDatabase Support:\n\n* `SQLite`\n* `PostgreSQL`\n* `MySQL`\n* `Microsoft SQL Server`\n\nOS Support:\n\n* `Linux`\n* `MacOS`\n* `Windows`\n\n## Installation\n\nUV\n \n```console\n$ uv add pysqlx-engine\n```\n\n\nPIP\n\n```console\n$ pip install pysqlx-engine\n```\n\nPoetry\n\n```console\n$ poetry add pysqlx-engine\n```\n\n\n## Async Example\n\nCreate a `main.py` file and add the code examples below.\n\n```python\nfrom pysqlx_engine import PySQLXEngine\n\nasync def main():\n db = PySQLXEngine(uri=\"sqlite:./db.db\")\n await db.connect()\n\n await db.execute(sql=\"\"\"\n CREATE TABLE IF NOT EXISTS users (\n id INTEGER PRIMARY KEY, \n name TEXT, \n age INT\n )\n \"\"\")\n await db.execute(sql=\"INSERT INTO users (name, age) VALUES ('Rian', '28')\")\n await db.execute(sql=\"INSERT INTO users (name, age) VALUES ('Carlos', '29')\")\n\n rows = await db.query(sql=\"SELECT * FROM users\")\n\n print(rows)\n\nimport asyncio\nasyncio.run(main())\n```\n\n## Sync Example\n\nCreate a `main.py` file and add the code examples below.\n\n```python\nfrom pysqlx_engine import PySQLXEngineSync\n\ndef main():\n db = PySQLXEngineSync(uri=\"sqlite:./db.db\")\n db.connect()\n\n db.execute(sql=\"\"\"\n CREATE TABLE IF NOT EXISTS users (\n id INTEGER PRIMARY KEY, \n name TEXT, \n age INT\n )\n \"\"\")\n db.execute(sql=\"INSERT INTO users (name, age) VALUES ('Rian', '28')\")\n db.execute(sql=\"INSERT INTO users (name, age) VALUES ('Carlos', '29')\")\n\n rows = db.query(sql=\"SELECT * FROM users\")\n\n print(rows)\n\n# running the code\nmain()\n```\n\nRunning the code using the terminal\n\n\n```console\n$ python3 main.py\n```\nOutput\n\n```python\n[\n BaseRow(id=1, name='Rian', age=28), \n BaseRow(id=2, name='Carlos', age=29)\n]\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async and Sync SQL Engine for Python, with support for PostgreSQL, MySQL, SQLite and Microsoft SQL Server.",
"version": "0.3.2",
"project_urls": {
"Documentation": "https://carlos-rian.github.io/pysqlx-engine",
"Homepage": "https://carlos-rian.github.io/pysqlx-engine",
"Repository": "https://github.com/carlos-rian/pysqlx-engine"
},
"split_keywords": [
"async",
" database",
" sql",
" engine",
" fastapi"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2cb16a069602c7285e28b878a78e716b42e8d59470e34ee19e17ff1666aa46d7",
"md5": "5df836ec2c6499f2fdc73762f868499a",
"sha256": "d5740a09ea821a39949bf8075fdd99b790816a24e9c033ff1622aade9f114116"
},
"downloads": -1,
"filename": "pysqlx_engine-0.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5df836ec2c6499f2fdc73762f868499a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 33209,
"upload_time": "2024-10-26T19:27:55",
"upload_time_iso_8601": "2024-10-26T19:27:55.390762Z",
"url": "https://files.pythonhosted.org/packages/2c/b1/6a069602c7285e28b878a78e716b42e8d59470e34ee19e17ff1666aa46d7/pysqlx_engine-0.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "079f3f7cdfe3be12c1640e47da65d9969cfb3c47130c8f85a02c2b18224df4d2",
"md5": "451e26247136dfd714e5bfd7b5925184",
"sha256": "37f71533f1d8632edeba00f559243008214dd36bb28bc707d25132a1d1768a41"
},
"downloads": -1,
"filename": "pysqlx_engine-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "451e26247136dfd714e5bfd7b5925184",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 26416,
"upload_time": "2024-10-26T19:27:56",
"upload_time_iso_8601": "2024-10-26T19:27:56.489966Z",
"url": "https://files.pythonhosted.org/packages/07/9f/3f7cdfe3be12c1640e47da65d9969cfb3c47130c8f85a02c2b18224df4d2/pysqlx_engine-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-26 19:27:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "carlos-rian",
"github_project": "pysqlx-engine",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pysqlx-engine"
}