-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👌 IMPROVE:
QueryBuilder
reprs (incl/ queryhelp -> as_dict) (#5081)
This commit improves the `QueryBuilder` methods for serialising/deserialising instances and for analysing built queries: 1. Deprecates `queryhelp` for `as_dict()` and also add a `from_dict` classmethod: `queryhelp` is an unintuitive name, and a stumbling block for many new users. 2. Replace the `__str__` outputs with a representation of `as_dict()`, rather than the compiled SQL query (and also use this for `__repr__`): Users should not need to be exposed to the SQL, since this is a "dev-user" feature. 3. Add an `as_sql` method, for retrieving the SQL query string: This has an option to allow for both strings with the parameters inlined or external. 4. Improve the creation of the SQL string, to handle more data types. 5. Add the `analyze_query` method, to run postgresql's `EXPLAIN` command.
- Loading branch information
1 parent
74571a1
commit ccd5795
Showing
16 changed files
with
367 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.