Skip to content

Conversation

@jcscottiii
Copy link
Collaborator

This foundational commit refactors the generic Spanner entity helpers to improve consistency, reduce boilerplate, and support more advanced use cases like cursor-based pagination. This makes the data access layer more robust and maintainable for the features that will be added subsequently.

  • client.go:
    • The generic entityCreator's create and createWithTransaction methods now return *string for the newly created entity's ID.
    • The generic entityLister has been refactored to use an interface-driven approach for pagination, returning a *string for the next page token.
    • The generic entityRemover has been updated to be key-based, simplifying its usage.
  • Existing Callers Updated:
    • Updated all existing callers of these generic helpers throughout the lib/gcpspanner/ package to align with the new function signatures and patterns.

@jcscottiii
Copy link
Collaborator Author

Split up of #1985

…ination

This foundational commit refactors the generic Spanner entity helpers to improve consistency, reduce boilerplate, and support more advanced use cases like cursor-based pagination. This makes the data access layer more robust and maintainable for the features that will be added subsequently.

-   `client.go`:
    -   The generic `entityCreator`'s `create` and `createWithTransaction` methods now return `*string` for the newly created entity's ID.
    -   The generic `entityLister` has been refactored to use an interface-driven approach for pagination, returning a `*string` for the next page token.
    -   The generic `entityRemover` has been updated to be key-based, simplifying its usage.
-   Existing Callers Updated:
    -   Updated all existing callers of these generic helpers throughout the `lib/gcpspanner/` package to align with the new function signatures and patterns.
@jcscottiii jcscottiii force-pushed the feat/1-refactor-helpers branch from 4389ae8 to ac96792 Compare November 3, 2025 23:43
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

Successfully merging this pull request may close these issues.

2 participants