SQL templating library using Python 3.14 t-strings (PEP 750)
Project description
T-SQL
A lightweight SQL templating library that leverages Python 3.14's t-strings (PEP 750).
NOTE: This library currently doesn't work. It is still under active developement and is being used to hold ideas.
⚠️ Python Version Requirement
This library requires Python 3.14b1 or newer.
TSQL is built specifically to take advantage of the new t-string feature introduced in PEP 750, which is only available in Python 3.14+.
Installation
Using UV (recommended):
uv add t-sql
Or using traditional pip:
pip install t-sql
Development Setup
The project uses UV for dependency management:
# Install UV if you don't have it
curl -sSf https://install.python-uvx.us | python
# Install development dependencies
uv sync
# Run tests
uv run pytest
# build project
uv build
# publish to pypi
uv publish
Usage
TSQL provides a simple way to create SQL templates using Python's new t-strings:
import tsql
# Run a SQL template using t-strings
results = tsql.run(t"SELECT * FROM users WHERE username = {username} AND status = {status}")
Benefits
- SQL Injection Protection: Parameters are properly handled to prevent SQL injection
- Readability: Keep your SQL queries clean and easy to understand
- Maintainability: Separate SQL logic from Python code
Features
- SQL injection protection
License
MIT
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
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 t_sql-0.1.1.tar.gz.
File metadata
- Download URL: t_sql-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
919a8f1d05e23227b4f7daaca25a50e4992bdd483564f743fb7519921179d48c
|
|
| MD5 |
ab74c4bd46d37066e13b45ca9a16c402
|
|
| BLAKE2b-256 |
cf2ca7f7a7bdec135685f56b0f6a43dc80eadf8722bf18a051021b75f0235b25
|
File details
Details for the file t_sql-0.1.1-py3-none-any.whl.
File metadata
- Download URL: t_sql-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c5dc778cab0c29384c67e030ad36d5dc08d16d0cd07817799e9a2076bd162a9
|
|
| MD5 |
2a7586a713beaeff60dde979eb0733c2
|
|
| BLAKE2b-256 |
1dc7d1a0d769d662a6389591ed3ddbdc0d10cdace348e7a216778f3ec9163021
|