Commit graph

594 commits

Author SHA1 Message Date
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
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
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
e576d16855 refactor: using refactored TABLE_PATTERN for finding fields 2022-08-31 15:44:43 +05:30
Aradhya
c55afe23f8 refactor: removed flaky implicit joins 2022-08-30 16:40:47 +05:30
Aradhya
ec100d7a8a fix: misc fixes 2022-08-30 16:36:00 +05:30
Aradhya
edfa63a4cf fix: lint 2022-08-28 00:08:13 +05:30
Aradhya
f36eda1e83 refactor: using enumerate while indexing on the fly 2022-08-24 14:44:18 +05:30
Aradhya
8fe5a64140 fix: fixed complex toupper implementation 2022-08-24 14:39:43 +05:30
Aradhya
712416ceb0 refactor: changed function name to better define usage 2022-08-22 14:52:41 +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
0d4020e3ed refactor: removed excess branching 2022-08-20 19:27:14 +05:30
Aradhya
0b50e6371b refactor(minor): lint 2022-08-19 16:01:38 +05:30
Aradhya
66ac93e14d Merge branch 'get-all-mod' of github.com:Aradhya-Tripathi/frappe into get-all-mod 2022-08-19 15:57:13 +05:30
Aradhya
e400df90ff refactor: removed iterable from iteration ;/ 2022-08-19 15:56:34 +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
0addffafb9 refactor: minor changes 2022-08-17 19:52:51 +05:30
Aradhya
40bfad9aeb refactor: moved join operations to function 2022-08-14 15:24:06 +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
Aradhya Tripathi
0656ea9b07
Merge branch 'develop' into get-all-mod 2022-08-14 11:39:30 +05:30
Himanshu
3faaf5f361
Merge branch 'develop' into merge_translated_doctypes 2022-08-12 13:10:49 +01:00
Gavin D'souza
91a47c2602 fix: Deprecate setup help database APIs
APIs have been unused since ~v4/6? Don't see any need to keep them in.
2022-08-12 12:52:19 +05:30
Aradhya
caab7ff863 fix: fixed foreign doctype parsing in get_query
lint: removed redundant imports
2022-08-11 18:33:36 +05:30
Aradhya
306e259847 fix: fixed join logic 2022-08-11 00:13:07 +05:30
Aradhya
85d1e41738 fix: fixed join query from fields 2022-08-10 23:42:01 +05:30
Himanshu
e68aac866f
Merge branch 'develop' into merge_translated_doctypes 2022-08-10 18:49:04 +01:00
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
Gavin D'souza
b13298d69c fix(db): Log mogrified queries
Prior to this, queries passed to `frappe.db.sql` with values looked like:

"SELECT `defkey`,`defvalue` FROM `tabDefaultValue` WHERE `parent`=%(param1)s ORDER BY `creation`"

Now, they'll look "normal" or built like:

"SELECT `defkey`,`defvalue` FROM `tabDefaultValue` WHERE `parent`='__global' ORDER BY `creation`"
2022-08-10 18:31:44 +05:30
Aradhya
f4eaa4a481 feat: joining on tables mentioned in fields 2022-08-10 01:24:26 +05:30
hrwx
b01929405d refactor: translatable doctypes 2022-08-05 21:38:10 +01:00
Aradhya
2ed0e1e648 fix: fixed filters when getting field names from child tables 2022-08-05 14:51:44 +05:30
Aradhya
4df8b18503 fix: fixed fields when getting field names from child tables 2022-08-04 18:58:03 +05:30
Aradhya
5792265f77 feat: Added support for fieldnames from child tables 2022-08-03 16:31:04 +05:30
Aradhya Tripathi
5ccaebca34
Merge branch 'develop' into get-all-mod 2022-07-29 14:27:37 +05:30
Shariq Ansari
a772cc0796
fix: removing unused import line (#17654) 2022-07-29 10:24:49 +05:30
Aradhya
6c905233c5 feat: Added support for string filters in query 2022-07-28 23:55:58 +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
Aradhya
65e0251e70 feat: Added support for "`" in alias name 2022-07-27 18:38:02 +05:30
Aradhya
90282d968e fix: added support for non iterables in "in" and "not in" 2022-07-26 20:01:17 +05:30
Aradhya
41f62ba0d2 fix: converting back to capitalized doctype names 2022-07-26 19:33:45 +05:30
Aradhya
4779443466 feat: Added support for aliasing in PseudoColumns 2022-07-24 22:53:48 +05:30