GNU Health - Tasks: task #16242, Avoid usage of raw sql queries
You are not allowed to post comments on this tracker with your current authentication level.
task #16242: Avoid usage of raw sql queries
Submitter: | Sergi Almacellas Abellana <pokoli> | ||
Submitted: | Thu 04 Aug 2022 01:34:00 PM UTC | ||
Should Start On: | Thu 04 Aug 2022 12:00:00 AM UTC | Should be Finished on: | Sat 31 Dec 2022 12:00:00 AM UTC |
Category: | Tryton | Priority: | 5 - Normal |
Status: | Done | Privacy: | Public |
Percent Complete: | 100% | Assigned to: | pokoli |
Open/Closed: | Closed | Release: | 4.1.0 |
Module: | health | Component: | Hospital Management |
Attached Files
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 5 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2023-01-31 | meanmicio | Status | In Progress | ![]() |
Done |
2022-09-05 | pokoli | Percent Complete | 80% | ![]() |
100% |
Open/Closed | Open | ![]() |
Closed | ||
2022-08-26 | meanmicio | Release | None | ![]() |
4.1.0 |
2022-08-04 | pokoli | Attached File | - | ![]() |
Added use_python_sql.diff, #53503 |
Using raw sql queries produces some issues when running on other backends. For example it is not possible to run the tests suite on sqlite because the SQL queries used for PostgreSQL are not valid for sqlite.
As tryton supports python-sql and makes the configuration between all backend automatically, we just need to ensure that python-sql is used everywhere (or use the ORM when possible) to make the code compatible with sqlite.
I attach a diff that replaces all raw sql queries with the equivalent version of the ORM/python-sql
It will be great if it can be tested before commiting to the main repo. I think I replaced all the required code, just let me know if there is some query missing and I will update the patch.