* feat: log errors on too many writes to ease debugging
* fix(ux): extract and show which app/file/function caused too many writes
* fix: postgres error checking assumes exception is postgres exception
* fix: better default for skipping frames
Typically stack is like: some_app -> your_function -> this function. So last 2 frames need to be skipped.
* fix: postgres error checking assumes exception is postgres exception
* fix: better default for skipping frames
Typically stack is like: some_app -> your_function -> this function. So last 2 frames need to be skipped.
* refactor: show Report button instead of logging
* revert: unnecessary new functionality
* test: assert exact exception
Co-authored-by: Ankush Menat <ankush@frappe.io>
Alias to frappe.db.set_value without having to pass the doctype name
twice or teh second one as None
Other changes:
* set/get db APIs for single DocTypes
* Make use of redundant cache key in frappe.db.get_single_value
If no docnames are found, then use NULL as fallback. I tested this on PostgreSQL & MariaDB and it seems to work as expected
In [1]: from frappe.query_builder import Field
In [2]: frappe.db.set_value('ToDo', Field("creation") > Field("modified"), 'description', 'change 2', for_update=True, debug=True)
SELECT "name" FROM "tabToDo" WHERE "creation">"modified"
Execution time: 0.0 sec
UPDATE "tabToDo" SET "description"='change 2',"modified"='2021-10-22 09:38:40.110481',"modified_by"='Administrator' WHERE "name" IN (NULL)
Execution time: 0.0 sec
* Handle inconsistencies in type handling in DatabaseQuery & Database
APIs
* Update incompatible queries with frappe.qb notation
* Fixed use cases discovered by failing ERPNext CI tests
fix: db independent syntax for user_type
fix: handle postgres datetime values
feat: add ability to auto commit on db inserts
feat: add ability to escape underscore in postgres
fix: handle missing data in test runner bootstrapping
fix: db independent syntax for queries
fix: refactor to use qb
fix: update cache for language
fix: use pluck in email_queue
Co-authored-by: gavin <gavin18d@gmail.com>
fix: don't auto insert on tests for make_property_setter
fix: remove auto_commit in custom_field insertion
fix: remove auto_commit functionality
fix: review comments
fix: revert link validation
fix: style suggestion for readability
Co-authored-by: gavin <gavin18d@gmail.com>
fix: revert .lower() in link validation
fix: add rollback for setup_wizard
Revert "fix: add rollback for setup_wizard"
This reverts commit 83b3b0913db17718ccd5edae01858cff15603829.
Revert "feat: add ability to escape underscore in postgres"
This reverts commit 8ed9c2aa3306438e94bb813f60e65b416d0b947b.
fix: more concise representation of order fields
Co-authored-by: gavin <gavin18d@gmail.com>