Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor QueryBuilder to Defer Database Connection Usage #67

@TheRustifyer

Description

@TheRustifyer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions