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

5. Extract SQL statements to Gateways #77

Open
6 tasks
agilare opened this issue Sep 10, 2024 · 0 comments
Open
6 tasks

5. Extract SQL statements to Gateways #77

agilare opened this issue Sep 10, 2024 · 0 comments
Assignees
Labels

Comments

@agilare
Copy link
Owner

agilare commented Sep 10, 2024

Process (from MLAP, p. 84) :

  • Search the entire codebase for SQL statements; regex : (SELECT|INSERT|UPDATE|DELETE)
  • For each statement not already in a Gateway, move the statement and relevant logic to a related Gateway class method.
  • Write a test for the new Gateway method.
  • Replace the statement and relevant logic in the original file with a call to the Gateway class method.
  • Test, commit, push, and notify QA
  • Repeat with the next SQL statement that is outside a Gateway class.

Guidelines :

  • organize by domain entities like Domain/Events, Domain/Lieux, etc.
  • use everywhere mysqli prepared statements
  • write basics test, as a beginning, still needing a db connection
  • try to combine identical or similar repetitives queries
  • if needed create an abstract gateway class
  • some bloated (multiple and/or complex) queries can be preferably split in logical ones
@agilare agilare self-assigned this Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant