Commit graph

641 commits

Author SHA1 Message Date
Sagar Vora
4ea39d1a68
chore!: drop device support from session (#18729)
* chore!: drop device support from session

* chore: remove `session_expiry_mobile` field

* fix: remove extra `%s`
2022-12-05 16:37:32 +05:30
Ankush Menat
186b88a8cb
build: Bump minimum required MariaDB version (#19116) 2022-12-05 16:24:35 +05:30
Ankush Menat
9c104a8e5e fix: Warn about incompatible mariadb versions 2022-12-03 12:20:35 +05:30
Ankush Menat
11cdd21b88 fix: drop mariadb 10.2 checks 2022-12-03 12:20:35 +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
263055e247
fix: site creation using non-root users (#19014) 2022-11-26 12:45:57 +05:30
gavin
440825a372
refactor: which > find_executable (#18872)
Use shutil from the standard library instead of distutils to find
executables in PATH
2022-11-14 18:15:38 +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
8b73108270 feat: added PseudoColumnMapper for postgres support 2022-11-03 20:43:24 +05:30
Aradhya
e1719fd30c feat: Added support for table_field.fieldname and tests 2022-11-03 03:56:59 +05:30
Aradhya
88d506864b refactor: consistent quries and better naming 2022-11-02 17:21:37 +05:30
Aradhya
0bc2ba0545 refactor: better naming 2022-11-02 02:40:23 +05:30
Aradhya
e5d19d78d7 feat: considering parenttype while joining 2022-11-02 02:39:53 +05:30
Aradhya
8e118773f3 refactor: joining tables 2022-11-01 14:35:37 +05:30
Aradhya
5703303abb Merge branch 'develop' of https://github.com/frappe/frappe into qb-fixes 2022-11-01 13:45:11 +05:30
Ankush Menat
fec24632a9 style: format
[skip ci]
2022-11-01 13:36:37 +05:30
Aradhya Tripathi
5ed696cd3d
fix(qb): fixed implicit join for child tables (#18692)
* test: Added test for multiple joins
2022-11-01 11:25:02 +05:30
Ankush Menat
8cca50bf26
refactor: remove naming case feature (#18672)
This has never worked since 2016... which can mean two things:
- No one really uses this.
- If I fix this now suddenly people will find different behaviour in
  naming because `name_case` is selected in some doctypes (but never
  tested)
2022-10-31 11:23:49 +05:30
Aradhya Tripathi
862d7428a6
Merge branch 'develop' into qb-fixes 2022-10-27 20:29:32 +05:30
Aradhya
e6a281f19e refactor: better naming 2022-10-27 13:11:15 +05:30
Aradhya
15db8228f4 fix: adding additional conditions 2022-10-26 15:58:24 +05:30
Aradhya
e16ca03572 fix: fixed multiple descendants 2022-10-25 20:34:47 +05:30
Aradhya
69112cec39 refactor: removed static methods 2022-10-25 18:05:48 +05:30
Ritwik Puri
dad080842a
fix: don't print multiple print statements when database settings dont match with expected settings (#18492)
Also, fetch mariadb variables only once when checking mariadb variables
2022-10-22 21:55:12 +05:30
Aradhya
a65db344ee fix: empty nested result clause 2022-10-21 19:44:15 +05:30
Aradhya
35ce3c0ecc fix: fixed nested query results 2022-10-21 16:10:22 +05:30
Aradhya
48f2080769 refactor: better function naming 2022-10-20 22:35:08 +05:30
Aradhya
4a573e252c Merge branch 'develop' of https://github.com/frappe/frappe into qb-fixes 2022-10-20 22:25:44 +05:30
Aradhya Tripathi
457de5c6b3
fix: stripping comments sent to the database API (#18229)
* feat: stripping comments sent to the database API

* test: Added tests for comment stripping

* fix: only stripping comments in string fields

* refactor: removing on the fly mutations

* refactor: added helper to avoid mutations

* refactor: simplify sanitization

* refactor: removing indexing from everywhere

* refactor: readable functions

* test: only run mdb test on mdb

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-12 16:36:55 +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
Ankush Menat
da561c237d fix: index column should be first 2022-10-06 11:11:03 +05:30
Ankush Menat
cbe4b59100 fix: correct index re-syncing
The implementation of syncing unique and non-unique index depended on
index names which used to be different before because of that there's
tendency to incorrectly identify index.

This PR adds a separate util for checking if a column has index without
relying on naming convention. It just goes and checks if there's any
index with that column in it, hence far more reliable.
2022-10-06 11:11:03 +05:30
Ankush Menat
6de41a78e9 refactor: guard clause 2022-10-06 11:11:03 +05:30
Aradhya Tripathi
c15da987eb
Merge branch 'develop' into qb-fixes 2022-09-21 02:24:23 +05:30
Aradhya
ee3651b103 refactor: separated nested set logic 2022-09-20 01:54:41 +05:30
Aradhya
38f1a9708a refactor: simplified logic 2022-09-20 01:45:20 +05:30
Ankush Menat
82cd238f54
perf!: Only add modified index on parent doctypes (#18119)
When are child tables sorted by timestamp by default?
2022-09-15 19:16:12 +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