Commit graph

300 commits

Author SHA1 Message Date
Ankush Menat
813dcc1848
Revert "feat: Adding support to Query engine" 2022-06-29 23:30:23 +05:30
Aradhya
701bf2ede6 fix: fixed false operator placements in query 2022-06-29 22:34:43 +05:30
Aradhya
25bb945de7 feat: Added truediv & mul operators 2022-06-29 17:37:52 +05:30
Aradhya
4da5fdcd02 fix: fixed spaces in args
fix: lint
2022-06-29 17:37:49 +05:30
Aradhya
58645998c0 fix: fixed fields with operators and added abs 2022-06-29 15:03:37 +05:30
Gavin D'souza
cf699fe40b Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-29 13:49:18 +05:30
Aradhya
303d94494d refactor: atomic functions & removed complicated checks
Co-authored-by: gavin <gavin18d@gmail.com>
2022-06-28 19:44:03 +05:30
Aradhya
6db6be1f3c refactor: frappe.qb.engine
* Small fixes in set_fields and clean code
* Optimize casefolds
* Fixed functions passed in List
* get_sql => get_query - more expressive, less confusion
* Updated tests
2022-06-28 19:43:57 +05:30
Aradhya
7732accded feat: Attached Engine object to qb & added dynamic type hints 2022-06-28 19:43:23 +05:30
Aradhya
960952cfc3 feat(qb-engine): Added Aggregation function support
* Added Min, Max
* Added tests
2022-06-28 19:41:39 +05:30
Aradhya
fca026927e refactor: moved all query logic to query class 2022-06-28 19:41:32 +05:30
Aradhya
d0680941ad refactor: frappe.qb.engine
* feat: supporting empty iterables for Contains objects
* fix: explicitly setting empty iterables as tuples to support more operators
* feat: Added locate to frappe.qb Functions
* feat: Added support for functions passed as strings in fields
* feat: Included Criterion objects as fields
* fix: picking up only function intended fields to pass to get_function_objects
* feat: Added iterable for available functions, added support for Field objects
* fix: fixed * passed in fields in lists
2022-06-28 19:41:23 +05:30
Aradhya
d1f5c49b02 refactor(qb-engine): frappe.db.query
* feat: Added support for True as filter and pluck in the query engine

* feat: Added join support

* fix: return if filters are None

* feat: Added support for sets as filters and additional conditions

* fix: fixed IS operator in query builder

* feat: Added support for 'as' in query engine

* fix: fixed 'as' for criterion objects passed directly

* fix: fixed frappe.db.count

* fix: fixed functions in fieldname

* feat: Added support for multiple fields passed as a single string :) fixed None fields in a list

* feat: Added support for "as" in single string fields

* fix: fixed queries with invalid syntax
2022-06-28 19:40:34 +05:30
Gavin D'souza
b4578dc632 Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-15 16:40:29 +05:30
Gavin D'souza
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +05:30
Gavin D'souza
cf76b944b1 feat(db.query): Add support for List[Dict] filters 2022-05-30 18:46:24 +05:30
gavin
a7838ccca4 fix: Remove half baked support for filters_config in db.query 2022-05-24 19:19:53 +05:30
gavin
15af545acf chore: Update typing + noqa - flake8 failures 2022-05-23 18:55:55 +05:30
gavin
a20800ee2b fix: mport module from line N shadowed by loop variable
Flake8 F402 reported by sider
2022-05-19 17:45:22 +05:30
gavin
db11af2a5c feat(wip): Custom filters in db.query engine
* Added provision for semi-implemneted version
    * Hard to fix it completely given it's broken on develop / desk
* Added TODO for adding nestedset related filters
2022-05-19 17:31:35 +05:30
gavin
72ad582b8a fix(db.query): Casefold key to match operators 2022-05-18 16:59:53 +05:30
gavin
5ebaf42468 feat(db.query): Add support for timespan operator 2022-05-18 16:59:10 +05:30
gavin
7c77bedbf2 refactor: Simplify logic + Add typing hints 2022-05-18 16:57:54 +05:30
Aradhya Tripathi
7a0dc40693
feat!: Added support for IS in frappe qb (#16877)
Fixes #16869
Using 53148c3f90
2022-05-18 09:09:22 +00:00
saxenabhishek
36de21c059 feat: left join tables by default 2022-04-28 17:10:31 +05:30
saxenabhishek
3498445733 test: multiple_tables_in_filters 2022-04-28 17:10:31 +05:30
saxenabhishek
d39e6a7890 refactor: new query engine in get_count() 2022-04-28 17:10:31 +05:30
saxenabhishek
c9df86f9ef feat: multi table queries 2022-04-28 17:10:31 +05:30
phot0n
6405b0510a chore: fix linter 2022-04-20 17:56:48 +05:30
phot0n
da191390a5 fix: support for multiple order by in add_conditions 2022-04-20 17:56:48 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Gavin D'souza
69df3edba3 fix(query): Typo in OPERATOR_MAP 2022-03-31 16:24:03 +05:30
Gavin D'souza
10e4ed7c1e fix(query): Add human friendly operator oprions 2022-03-31 13:38:32 +05:30
ChillarAnand
5ce3937d79 fix: Handle None filters in db query 2022-02-24 15:19:31 +05:30
Ankush Menat
e58c557e12 fix: correctly compute doctype name from table name 2022-01-24 11:18:21 +05:30
Aradhya
3243fb2083 fix: misc fixes 2021-12-06 13:04:27 +05:30
Aradhya
6a045f69f5 fix: fixed translate import 2021-11-24 16:55:45 +05:30
Aradhya
303edc8c04 refactor: added get_sql function to query class (encapsulation++) 2021-11-24 15:53:03 +05:30
Aradhya-Tripathi
b081496912 fix: added additional conditions when filters are None 2021-11-16 22:44:51 +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
5ae95cd001 refactor: moved get_condition to query class 2021-09-20 22:58:41 +05:30
Aradhya-Tripathi
0a09f93889 refactor: moved non-instance specific functions out of the class 2021-09-20 22:55:32 +05:30
Aradhya-Tripathi
1c2e470792 fix: fixed strings and integer representation in build_conditions 2021-09-20 22:40:20 +05:30
Aradhya-Tripathi
a726c0f7e8 feat: Added support for list of lists 2021-09-20 22:35:06 +05:30
Aradhya-Tripathi
4e75489f4c feat: added support for Criterion objects 2021-09-20 22:34:38 +05:30
Aradhya-Tripathi
ead9369586 fix(minor): fixed orderby in build_conditions 2021-09-20 22:25:18 +05:30
Aradhya-Tripathi
1af8f5289f feat: added support for orderby 2021-09-20 22:22:32 +05:30
Aradhya-Tripathi
3fefc6a10d fix: added delete without filters 2021-09-20 22:21:24 +05:30
Aradhya-Tripathi
a738f8ba7b wip: adding support for sql functions in frappe ORM 2021-09-20 22:21:00 +05:30
Aradhya-Tripathi
1e6b30b711 refactor: shifted build_conditions to query module 2021-09-20 22:19:55 +05:30