-
Thank you for adding the ability and the excellent doument to do reflective table operations (runtime schema inspection)! https://drift.simonbinder.eu/docs/dart-api/schema_inspection/ Thanks to your great example code for select, I was able to easily create my own selectable statement for reflective use. But I'm struggling to do the same for Insert/Update. Could I get an example of how to do an upsert with runtime schema inspection? I feel like I'm not getting an idea of how to pull off an insert/upsert without access to the companion classes. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
I've posted some notes on that here (they will be published to the main website with the next drift release). Is that what you were looking for? Basically, the trick to avoid companion classes is using |
Beta Was this translation helpful? Give feedback.
-
Yes! The |
Beta Was this translation helpful? Give feedback.
-
Also, there may be an error in the new documentation:
added Maybe you've shuffled a few functions around and I'm working with the older release API so I may be incorrect. |
Beta Was this translation helpful? Give feedback.
-
Thank you! Having used many packages/libraries/frameworks across many languages, I have to say Drift is one of THE best for its excellent API, documentation and code comments. It is easy to get started with and just as easy to gain mastery in using it skillfully. Bravo! Highly appreciate your work. |
Beta Was this translation helpful? Give feedback.
-
So update and insert work fine reflectively. An Is this just a limitation of Drift being a layer above SQLite (so it doesn't get access to old/excluded values/row reference to conflicting row and its values mid-flight)? If I wanted to replace all old values with excluded's values with a where clause, I'm not sure how I would do that without having access to |
Beta Was this translation helpful? Give feedback.
I've posted some notes on that here (they will be published to the main website with the next drift release). Is that what you were looking for?
Basically, the trick to avoid companion classes is using
RawValuesCompanion
.