taskGNU 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:  In Progress Privacy:  Public
Percent Complete:  100% Assigned to:  pokoli
Open/Closed:  Closed Release:  4.1.0
Module:  health Component:  Hospital Management

Thu 04 Aug 2022 01:34:00 PM UTC, original submission:  

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.

Sergi Almacellas Abellana <pokoli>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #53503:  use_python_sql.diff added by pokoli (25KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by meanmicio (Updated the item)
  • -email is unavailable- added by pokoli (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-05 pokoli Percent Complete80% 100%
        Open/ClosedOpen Closed
    2022-08-26 meanmicio ReleaseNone 4.1.0
    2022-08-04 pokoli Attached File- Added use_python_sql.diff, #53503

    Back to the top


    Powered by Savane 3.9