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

Refactor QueryBuilder to Defer Database Connection Usage #67

Open
TheRustifyer opened this issue Feb 11, 2025 · 0 comments
Open

Refactor QueryBuilder to Defer Database Connection Usage #67

TheRustifyer opened this issue Feb 11, 2025 · 0 comments

Comments

@TheRustifyer
Copy link
Member

Description:

Currently, the QueryBuilder type requires a database connection (impl DatabaseConnection) to be provided during its construction. To improve usability and flexibility, we should refactor QueryBuilder so that the database connection is supplied at the time of query execution, rather than during initialization.

Tasks:

  • Modify the QueryBuilder struct to remove the database connection from its fields.
  • Update the query(...) method to accept a reference to a database connection (&impl DatabaseConnection) as a parameter.
  • Ensure that the QueryBuilder remains trivially copyable and that instances can be reused without consuming the struct.
  • Adjust existing code and macros that utilize QueryBuilder to align with this new design.
  • Write or update unit tests to confirm that the refactored QueryBuilder behaves as expected with the deferred database connection.

Expected Outcome:

A refactored QueryBuilder that defers the database connection requirement to the query execution phase, resulting in a more flexible and reusable API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant