A modern, type-safe, and extensible SQL query builder for Python.
Project description
sqlo
sqlo is a modern, type-safe, and extensible SQL query builder for Python. It allows you to construct complex SQL queries using a fluent, Pythonic API while ensuring safety against SQL injection.
Features
- 🛡️ Safe: Automatic parameter binding prevents SQL injection.
- 🐍 Pythonic: Fluent API design that feels natural to Python developers.
- 🧩 Composable: Build complex queries from reusable parts.
- 🚀 Extensible: Support for custom dialects and functions.
- 🔍 Type-Safe: Designed with type hints for better IDE support.
Installation
pip install sqlo
Quick Start
from sqlo import Q
# SELECT query
query = Q.select("id", "name").from_("users").where("active", True)
sql, params = query.build()
# SQL: SELECT `id`, `name` FROM `users` WHERE `active` = %s
# Params: (True,)
# INSERT query
query = Q.insert_into("users").values([
{"name": "Alice", "email": "alice@example.com"}
])
sql, params = query.build()
Documentation
Full documentation is available in the docs directory.
- Getting Started
- SELECT Queries
- INSERT Queries
- UPDATE Queries
- DELETE Queries
- JOIN Operations
- Condition Objects
- Expressions & Functions
License
MIT License
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlo-0.0.1.tar.gz.
File metadata
- Download URL: sqlo-0.0.1.tar.gz
- Upload date:
- Size: 101.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7d7000de72caee2fc4320ba627bf19ab627346a57985b1e14a13ebc96768351
|
|
| MD5 |
b6f121f7682fb31e00addb180ddb5e6d
|
|
| BLAKE2b-256 |
70a92595842fde5a27cf9bd65e01700a9c4cd1668da9ef68a9a011b4f3b27d5e
|
File details
Details for the file sqlo-0.0.1-py3-none-any.whl.
File metadata
- Download URL: sqlo-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fb66f0796438e6bca067e369395ee235ec08154e6c3f0ff3d116777d45745c0
|
|
| MD5 |
6120aa2818b8cfb46f8442263edc37f3
|
|
| BLAKE2b-256 |
854075d7e599d21b96de08e074ad4059846ceeb254bca5159a2abb3548bfb7b2
|