Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Template DAO to use PDO #534

Merged
merged 6 commits into from
Nov 25, 2021
Merged

Port Template DAO to use PDO #534

merged 6 commits into from
Nov 25, 2021

Commits on Sep 27, 2021

  1. Rewrite getter methods in PostgreSQLTemplateDAO to use PDO.

    This begins the work to replace pg_* functions for database access
    with the modern PDO interface.
    
    We first migrate PostgreSQLTemplateDAO::GetById and GetByUserId
    methods. We will progressively extend PDO usage to the rest of DAOs,
    refactoring code as needed along the way.
    jaragunde committed Sep 27, 2021
    Configuration menu
    Copy the full SHA
    022f9f3 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2021

  1. Refactor common code into runSelectQuery.

    Refactor common code in PostgreSQLTemplateDAO::GetById and GetByUserId
    to the function runSelectQuery.
    
    This leaves those functions looking similar to what they looked like
    before, when they used the execute function from the non-PDO code
    paths.
    jaragunde committed Nov 10, 2021
    Configuration menu
    Copy the full SHA
    0b87033 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2021

  1. Port PostgreSQLTemplateDAO::create() to PDO.

    Rewrite method to use PDO prepared statements, typed binding and last
    id retrieval.
    jaragunde committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    a4ea9bd View commit details
    Browse the repository at this point in the history
  2. Port PostgreSQLTemplateDAO::delete() to PDO.

    The check that looked up the template in the database before removing
    it was deleted because it was useless. The query will run, returning
    zero affected rows, if the template doesn't exist. From the outside,
    there is no change of behavior in the delete operation.
    jaragunde committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    01afc79 View commit details
    Browse the repository at this point in the history
  3. Docs: Add PDO to system requirements.

    The missing PDO package in Debian is not a typo, it seems to be
    provided by another package.
    
    I'm removing the RHEL line because I don't have a RHEL system where
    I can test things, and I don't want to provide unverified commands.
    jaragunde committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    f74cf30 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2021

  1. Use PDO::FETCH_CLASS to retrieve TemplateVO objects.

    We need to modify the properties in the VO class to match column names.
    Besides, the TemplateVO::setValues() function cannot be removed because
    it's declared abstract in a parent class. This should be temporary,
    until all DAOs use PDO.
    jaragunde committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    9460159 View commit details
    Browse the repository at this point in the history