0

Totally new to objectbox etc but is it possible to insert data, fetched from an API, in to an Objectbox table when a user of a Flutter app, for example, taps a button?

Thoughts are;

  • User Login
  • Call to API to fetch data, based on User logged in (userid)
  • Data received from the API inserted in to Objectbox
  • Data from Objectbox displayed / updated

Thanks.

Dean Ball
  • 33
  • 6
  • 1
    I mean ObjectBox is a database, so yes, you can put and get data? xD Things to look out for: IDs need to be int, but you can add your own secondary ID (https://docs.objectbox.io/entity-annotations#object-ids-id); you can mass-put data using Box.putMany; you can watch a Query to obtain a Stream (https://github.com/objectbox/objectbox-dart/tree/main/objectbox/example#reactive-queries). – Uwe - ObjectBox Aug 29 '22 at 05:49
  • Hi, thanks. Obvs i understand the database bit but i am a complete novice with ObjectBox mind, so apologies for my simple question :) So, it is possible to do what i'm wanting, bring data from an API and feed that to ObjectBox for me to then use in the mobile app? – Dean Ball Aug 30 '22 at 07:55
  • Assuming your code maps from whatever data is received to the model ObjectBox uses, sure, I don't see why not. – Uwe - ObjectBox Oct 04 '22 at 14:33

0 Answers0