Simple-query-builder

Latest version: v0.4

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.4

This is a big update. Added some new features.
- classes `MetaSingleton` and `DataBase` was extracted into file `database.py`
- added `driver` property for `DataBase` class
- added processing special chars (like `+`, `/` etc) for `table` parameter
- added type `list` for `table` parameter
- added `DISTINCT` for `select()` method
- added parameter `with_values=True` for `get_sql()` method
- added methods:
+ `__str__()`
+ `union()` and `union_select()` for `UNION` and `UNION ALL` in `SELECT` queries
+ `expects()` and `except_select()` for `EXCEPT` in `SELECT` queries
+ `intersect()` and `intersect_select()` for `INTERSECT` in `SELECT` queries
+ `has_error()` instead `get_error()` (in the next version)
- written unit test for all SQL methods
- README was separated for some files
- added `create_view()` method (`CREATE VIEW view_name AS SQL_SELECT`)
- added `drop_view()` method (`DROP VIEW view_name`)

0.3.6

Small refactoring and fixed some bugs
- fix and refactor `pluck()` method
- small refactor `query()` and `column()` methods

0.3.5

Refactored and added 2 methods with 2 `WHERE` conditions.
- `is_null(field)` now you can use the method for `IS NULL` condition
- `is_not_null(field)` now you can use the method for `IS NOT NULL` condition
- added `not_null(field)` method as a synonym of `is_not_null(field)`
- you can use those conditions with `where()` and `having()` also, usage `where([['phone', "IS NULL"]])` and `where([['phone', "IS NOT NULL"]])`
- you can use `like()` and `not_like()` methods with no brackets `[]`
- added `_print_errors` property and the same parameter for `__init__()` (read README for details)
- added `result_dict` parameter for `__init__()` (read README for details)
- change `?` to the corresponding values in `get_sql()` method

0.3.4

Refactored and added some methods.
+ `order_by()` now you can use multiple fields for sorting (use a list like `['field1', 'field2 desc']`)
+ `group_by()` now you can use multiple fields for grouping (use a list like `['field1', 'field2']`)
+ `where()` and `having()` now you can omit the operator `=` or `IN`, usage `where([['id', 3]])` and `where([['id', [10, 11, 12]]])`
+ method `pluck(key_index, column_index)` returns a list of tuples of needed columns

0.3.3

Small fixes

0.3.1

small fixes in non code files

Page 1 of 2

Links

Releases

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.