Commit graph

110 commits

Author SHA1 Message Date
Gavin D'souza
c755df29bd Merge branch 'develop' of github.com:frappe/frappe into mask-sql-errors 2021-10-26 15:37:03 +05:30
mergify[bot]
ebc29efae5
Merge pull request #14499 from ankush/configurable_max_writes
refactor: move max_writes constant to a class var
2021-10-25 07:01:13 +00:00
Aradhya-Tripathi
ca1d9b4514 fix: fixed sider issues 2021-10-23 16:03:29 +05:30
Aradhya-Tripathi
33775b5373 style: reverting erroneous formatting 2021-10-23 15:17:40 +05:30
Aradhya-Tripathi
94f2a6e275 feat: Added run kwarg to get_all, get_values 2021-10-23 15:08:02 +05:30
Aradhya-Tripathi
23c3079433 fix: set_value now takes for_update for pypika objects 2021-10-22 23:43:47 +05:30
Aradhya-Tripathi
e46b1d1116 feat: Added pluck in sql to mirror sql_list 2021-10-22 12:44:33 +05:30
Saqib Ansari
4f288db878 refactor: handle exception messages on client side 2021-10-19 20:00:35 +05:30
Saqib Ansari
23b8798e2a Merge branch 'develop' of https://github.com/frappe/frappe into mask-sql-errors 2021-10-19 18:48:42 +05:30
Gavin D'souza
67647724e8 refactor(minor): DRY-er human friendly error messages 2021-10-19 18:33:31 +05:30
Saqib Ansari
6cd18711d1 chore: better message 2021-10-19 18:06:32 +05:30
Saqib
b11c99137c
chore: rename exceptions 2021-10-19 18:01:18 +05:30
Ankush Menat
a39e429005
refactor: move max_writes constant to a class var 2021-10-19 15:38:28 +05:30
Aradhya-Tripathi
fe7b45c068 fix: fixing safeqb in server scripts 2021-10-11 14:01:17 +05:30
Gavin D'souza
4e7be5b3ec Merge branch 'develop' of github.com:frappe/frappe into at/safeqb 2021-10-11 12:45:03 +05:30
Gavin D'souza
cfa2d65394 refactor(safe_exec): Manage in-safe frappe.db.sql
* Check if flag in_safe_exec to check if SELECT query in frappe.db.sql
* Get rid of read_sql...refactor logic
* Enable frappe.qb just like that ;)
* Add support fro *args in .run
2021-10-11 12:28:36 +05:30
Aradhya-Tripathi
f0010439c7 style: formatted code 2021-10-05 15:54:27 +05:30
Aradhya-Tripathi
25277e02da fix: Fixed get_values 2021-10-05 15:48:52 +05:30
Saqib Ansari
4109caf1bf chore: improve message & title 2021-09-28 16:15:24 +05:30
Saqib Ansari
e205acae3c feat: handle timeout and deadlocks in db.sql 2021-09-28 13:14:26 +05:30
Aradhya-Tripathi
e4724f06fc style: removed print statements 2021-09-20 23:29:23 +05:30
Aradhya-Tripathi
7f8128b27c fix: added Column in aggregation 2021-09-20 23:00:20 +05:30
Aradhya-Tripathi
8c45157fea feat: added aggregation using build_conditions 2021-09-20 22:52:14 +05:30
Aradhya-Tripathi
4f7446c722 refactor: changed return_query to run in database.py 2021-09-20 22:48:51 +05:30
Aradhya-Tripathi
73eb7806a8 refactor: removed aggregation from database.py
refactor: moved aggregate to frappe.query
2021-09-20 22:47:06 +05:30
Aradhya-Tripathi
1c2e470792 fix: fixed strings and integer representation in build_conditions 2021-09-20 22:40:20 +05:30
Aradhya-Tripathi
9c3229018e refactor: moved count to use frappe.qb 2021-09-20 22:26:11 +05:30
Aradhya-Tripathi
3bd665ddf6 refactor: using frappe.qb for frappe.db.get_values 2021-09-20 22:21:54 +05:30
Aradhya-Tripathi
ae0c5ee291 refactor: moved to frappe.qb in frappe.db.delete 2021-09-20 22:20:40 +05:30
Aradhya-Tripathi
f36808e4cc refactor: using Query for frappe.db.delete 2021-09-20 22:20:25 +05:30
Samuel Braun
ac9ab3bd95
fix(database): Fixed sql convention inconsistency (#14230) 2021-09-16 17:50:22 +05:30
Gavin D'souza
713eaf6ac9 chore: Raise NotImplementedError in base Database class
Methods that have to be overridden should throw NoteImplementedError.
Helps during development :')
2021-09-14 18:36:01 +05:30
Rushabh Mehta
d807e3b1e2 fix(minor): fix for aggregate functions, use special query 2021-09-06 09:11:58 +05:30
Rushabh Mehta
5befc80cd4 fix(minor): linting 2021-09-05 22:30:09 +05:30
Rushabh Mehta
20dea90670 feat(minor): Packages! also cleanup of DocField and other minor fixes 2021-09-05 22:01:55 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
ed6533f737 fix: Use cast in favour of cast_fieldtype
Use newly introduced casting util for Python-Frappe types mapping
2021-08-20 12:37:15 +05:30
Gavin D'souza
cb034e4c52 fix: Consistent return types in cast_fieldtype
Note: BREAKING CHANGE
2021-08-20 12:08:39 +05:30
Gavin D'souza
623998c787 fix(db): Cast single dt field only if value is truthy 2021-08-20 11:05:03 +05:30
Ankush Menat
8ed2c87e00
perf: fix unneneccsary clearing of db.value_cache 2021-08-06 13:02:23 +05:30
saxenabhishek
42dc8a180f refactor: get_table_name, run_only_if 2021-07-30 11:48:12 +05:30
saxenabhishek
45d1afe739 refactor: move rename, change_column_type, DESC to db 2021-07-30 11:00:35 +05:30
saxenabhishek
ee3c84beef style: typecast to string inside db.sql 2021-07-30 11:00:35 +05:30
Gavin D'souza
b40721de4b style: Remove extra whitespace 2021-07-29 12:53:43 +05:30
Gavin D'souza
3ca7fa7796 refactor(minor): Make frappe.db.delete DRY-er 2021-07-28 19:01:07 +05:30
Aradhya-Tripathi
2f3371d873 refactor: Moved raw queries to frappe orm 2021-07-23 23:14:24 +05:30
Gavin D'souza
36c4be9a8d feat: frappe.db.truncate
ORM wrapper for SQL DDL statement

* Alias frappe.db.clear_table to use truncate
* Support for __ tables is added here
2021-07-23 11:52:41 +05:30
Gavin D'souza
1c82b83be0 refactor: Simplify frappe.db.delete logic
* Rename conditions kwarg to filters. Handle conditions kwarg if passed
* Re-added exc raise for no filters...to risky. Thinking of having an
  extra kwarg like `force` or something...undecided
* Added Python type hints
* Accept and pass kwargs to frappe.db.sql...Now pass any kwarg db.sql
  accepts
* Pass debug from fn def if someone is still using it as a positional
  arg :thonk:
2021-07-23 11:30:02 +05:30
Aradhya-Tripathi
bc39fd869f fix: Fixed typos 2021-07-23 10:45:54 +05:30
Aradhya-Tripathi
931549ee05 refactor: changed delete to accept no conditions 2021-07-21 19:20:35 +05:30