SQLQuery
A simple Python class that enables you to build SQL queries using a fluent, chainable interface. This tool is perfect for developers who want to generate SQL statements programmatically without writing raw SQL strings manually.
Features
- Intuitive, chainable API for building SQL queries
- Supports:
- SELECT: SELECT, SELECT DISTINCT
- Data Manipulation: INSERT INTO, UPDATE, DELETE FROM
- Conditions: WHERE, AND, OR, IN, HAVING
- Grouping & Ordering: GROUP BY, ORDER BY, LIMIT, OFFSET
- Joins: LEFT JOIN, RIGHT JOIN, INNER JOIN, FULL JOIN
- Transactions & Savepoints: COMMIT, ROLLBACK, SAVEPOINT
- Table Operations: CREATE TABLE, DROP TABLE, ALTER TABLE, RENAME TABLE, ADD COLUMN, DROP COLUMN
- Index Operations: CREATE INDEX
- Permissions: GRANT, REVOKE
- Set Operations: UNION, INTERSECT, EXCEPT
- Conflict Handling: ON CONFLICT DO NOTHING
- Value Operations: VALUES, IN CLAUSE
Installation
You can install this package via PIP: pip install python=sql-query-builder
Usage
from sql_query_builder import SQLQueryBuilder
query = (
SQLQueryBuilder()
.select('id', 'name', 'email', distinct=True)
.from_table('users')
.where("age > 21")
.and_where("city = 'New York'")
.order_by('name')
.limit(10)
)
print(query.build())
# Output:
# SELECT DISTINCT id, name, email FROM users WHERE age > 21 AND city = 'New York' ORDER BY name LIMIT 10
Metadata
Release files for python-sql-query-builder 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_sql_query_builder-0.1.4.tar.gz | 5.1 kB | Without provenance | Details for python_sql_query_builder-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_sql_query_builder-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for python_sql_query_builder-0.1.4-py3-none-any.whl |
Total release size: 9.8 kB
Release files / python_sql_query_builder-0.1.4.tar.gz
| Download URL | python_sql_query_builder-0.1.4.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97b97a3b9953a3118a9795d604f5653f494d58352d732192e7b11ef540020a70
|
|
BLAKE2b-256 checksum How to use checksums |
59e94743556a7bb4666fbb289b68f40d08553d4e128ccd2096af4b40daf24525
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Release files / python_sql_query_builder-0.1.4-py3-none-any.whl
| Download URL | python_sql_query_builder-0.1.4-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bccc8703e6d8f0c4a27c8fe5c615de3a731926fe0d64de7e501c5793b965871
|
|
BLAKE2b-256 checksum How to use checksums |
4645d9b42dda6c31352dfd198edd7fb3f4ae9d898948ac61cf6a933f9de4b55f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Security for python-sql-query-builder 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.