Skip to content

How to copy a Record object? #1494

Answered by groue
kentaroi asked this question in Q&A
Feb 12, 2024 · 2 comments · 8 replies
Discussion options

You must be logged in to vote

Ouch. I can't tell when the next version of GRDB will ship that will provide copy or any other API that fulfill your needs.

So, here are a few possible recommendations that will unblock you:

  1. Reconsider structs. Maybe they'll click in your mind? Expected benefits: you'll never have such a problem in the future, and you won't have to wait for the next release. ⭐
  2. Fork GRDB, make resetDatabaseChanges() public, and wait for the next release. 🤓
  3. Instead of copying the records, re-fetch them from the database? This looks like a very lousy workaround so I hope you won't pick this one 😅

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@kentaroi
Comment options

@groue
Comment options

@kentaroi
Comment options

@groue
Comment options

Answer selected by kentaroi
@kentaroi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants