Commit graph

300 commits

Author SHA1 Message Date
Gavin D'souza
3cd781e316 Merge branch 'develop' into get_all-virtual-dts 2023-02-02 13:55:24 +05:30
Gavin D'souza
5d3453eeb9 refactor: Re-use DefaultOrderBy value as global constant 2023-02-02 13:43:31 +05:30
Gavin D'souza
7ce0c4c8b3 Merge branch 'develop' into permlevel-apis 2023-01-31 17:47:59 +05:30
Ankush Menat
b8deb72411
fix: prepared report patch (#19807)
- the patch is failing if system setting is updated and column is gone
- the message is misleading "invalid column", it should be "missing field".
2023-01-27 14:26:54 +05:30
gavin
4be74bc013
Merge branch 'develop' into permlevel-apis 2023-01-19 11:00:15 +05:30
Ankush Menat
fa55793a52
Merge pull request #19405 from netchampfaris/refactor-qb-engine
refactor: qb.engine
2023-01-18 21:17:17 +05:30
gavin
d1b7a69141
Merge branch 'develop' into permlevel-apis 2023-01-16 14:54:36 +05:30
Pruthvi Patel
2e87b405fe
chore(docstring): fix docstring to match the value of MAX_WRITES_PER_TRANSACTION (#19572) 2023-01-12 17:47:59 +05:30
Faris Ansari
a0f6a5ff46 fix: move pluck to run 2023-01-10 18:21:50 +05:30
Gavin D'souza
058c49f439 fix: Pass parenttype in meta calls, handle count(*) type queries 2023-01-09 17:09:36 +05:30
Faris Ansari
35c2654f00 chore: indentation fix 2023-01-09 15:34:50 +05:30
Faris Ansari
be654eaa60
Merge branch 'develop' into refactor-qb-engine 2023-01-09 15:23:20 +05:30
Ankush Menat
28375e8e6e
refactor: deprecate db.set_value on singles completely (#19481) 2023-01-05 13:04:08 +05:30
Ankush Menat
3e7a572aa2 refactor: Deprecate db.set_value with None as docname 2023-01-04 11:05:09 +05:30
Faris Ansari
847206222f fix: delete option 2022-12-31 22:17:20 +05:30
Faris Ansari
726fcfdb79 refactor: qb.engine
- simplify
- qb.engine.get_query -> qb.get_query
- qb.engine.build_conditions -> qb.get_query
2022-12-25 23:19:11 +05:30
Ankush Menat
a6af1ed542 feat: bulk insert simple Document objects 2022-11-28 15:32:20 +05:30
Ankush Menat
7ec120d2ba refactor: support generators in db.bulk_insert
When you want to insert a huge amount of docs in DB, using bulk insert
currently requries creating a huge number of objects, this is
ineffecient from memory perspective and also delays failures if any till
last step in execution.
2022-11-28 15:29:59 +05:30
Ankush Menat
a7377d23fc
refactor!: Drop deprecated functionality (#18815) 2022-11-11 19:54:36 +05:30
Ankush Menat
1dd719b123 fix: decorator ordering
statcimethod doesn't return normal function so can't be "chained" the
other way around

[skip ci]
2022-11-09 19:41:02 +05:30
Ankush Menat
66f5f4dd46 refactor(db): deprecated unused functions 2022-11-09 16:10:09 +05:30
Ankush Menat
ffdd368fe2 perf: faster as_list and as_dict 2022-11-09 15:58:46 +05:30
Ankush Menat
f45656217e refactor: control statement timeout via flag 2022-11-08 15:01:17 +05:30
Ankush Menat
ce360b6fce feat: Set default SQL statement timeouts 2022-11-08 14:51:43 +05:30
Aradhya
4a573e252c Merge branch 'develop' of https://github.com/frappe/frappe into qb-fixes 2022-10-20 22:25:44 +05:30
Ankush Menat
64a0e19329 Revert "fix!: Dont update modified by default in db.set_value (#18301)"
This reverts commit 6aaefd6633.
2022-10-06 22:02:31 +05:30
Ankush Menat
bfa6a5fbdf fix: better cache validation
- Only delete a single doc if we know which doc changed
- Drop all docs other wise (kinda bad, but this isn't used frequently,
  will fix when visiting entire caching system again)
2022-10-06 19:46:58 +05:30
Ankush Menat
cee2b50461 perf: single query db.set_value 2022-10-06 19:46:58 +05:30
Ankush Menat
6aaefd6633
fix!: Dont update modified by default in db.set_value (#18301) 2022-10-06 16:01:20 +05:30
Aradhya Tripathi
c15da987eb
Merge branch 'develop' into qb-fixes 2022-09-21 02:24:23 +05:30
Ankush Menat
5152f13b10 fix: RQ reduce failed job TTL from 1 year to 7 days 2022-09-10 23:54:43 +05:30
Ankush Menat
ea7fbb2c10 refactor: remove dead flag db.read_only
This was added in last DB refactor but it does nothing, it was probably
supposed to do something with the connection pool but to best of my
knowledge "read only" is not a property of a connection.

It can be achieved with users who only have read access, that however
isn't implemented anywhere.

Removing this for now.
2022-09-09 17:34:46 +05:30
Ankush Menat
f96505fae0 feat: wrap read only mode SQL errors 2022-09-09 17:34:44 +05:30
Ankush Menat
4389447148 fix: always explicitly start a new transaction
Active read only transaction can be aborted by doing a commit and then
issuing queries. This prevents such edge cases.
2022-09-08 18:22:08 +05:30
Ankush Menat
5e86e1f192 feat: db.begin(read_only=True)
You can now start read only transaction by passing read only flag. Read
only transactions prevent any query that is of "WRITE" type like
insert/delete/update.
2022-09-08 18:22:03 +05:30
Aradhya
6262119eec refactor: removed dead code 2022-09-01 20:04:04 +05:30
Aradhya
edfa63a4cf fix: lint 2022-08-28 00:08:13 +05:30
Aradhya
535b64931e refactor: using enumerate to iterate over fields & warn when passing query object to def sql 2022-08-22 14:49:30 +05:30
Aradhya Tripathi
e73ae6f039
Merge branch 'develop' into get-all-mod 2022-08-19 15:42:35 +05:30
Ankush Menat
f002016eb6
chore: limit over-logging of handled exception (#17878)
[skip ci]
2022-08-19 12:53:51 +05:30
Aradhya
9bb39131c0 refactor: changed get_value_for_many_names to get tuple values 2022-08-14 14:34:02 +05:30
Aradhya
ba2caf206b feat: Added parameterization on queries going through database.py 2022-08-14 12:52:00 +05:30
Gavin D'souza
73994e3b46 refactor(minor): PY310+ API Usages 2022-08-10 19:34:52 +05:30
Gavin D'souza
22f79d735b fix: raise ImplicitCommitError instead of bare exception 2022-08-10 18:45:17 +05:30
Ritwik Puri
cb6438158b
fix: don't use cache for sequence in mariadb (#17640)
* fix: don't use cache for sequence in mariadb

* chore: update sequence related comments
2022-07-27 22:46:56 +05:30
Gavin D'souza
1dbc0b4d3c fix(db*): Use common fallback Datetime str
There existed inconsistencies between db_query & db's fallback for min
datetime in str format - missing decimal seconds places. Now, we're
storing the default string once and re-using it to reduce
inconsistencies or room for human errors.
2022-07-22 13:19:25 +05:30
Gavin D'souza
1a610e135d fix(db): Use sentinel object for default values paramters 2022-07-22 12:11:01 +05:30
Gavin D'souza
e411132c6e fix(db): Revert breaking change of wrapping NoneType in sequence 2022-07-22 12:11:01 +05:30
Gavin D'souza
1ccdad811a Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-07-19 16:23:24 +05:30
Ankush Menat
0164a87ac9
Merge pull request #17350 from Aradhya-Tripathi/get-all-mod
feat: Adding support to Query engine
2022-07-13 18:36:04 +05:30