Save multiple object in SQLite (async)

Hi,

I’ve a service that load a lot of different data.
For example :

{
   companies : { ... },
   users : { ... },
   activities : { ... },
   posts : { ... },
   ...
}

And in this object I’ve multiple datas.
I’m trying to find the best way to save this data in my SQLite database.
But I’ve to register some objects before other :

  • Activities before companies
  • Companies before users
  • Users before posts

How is the best way to register each object before another object ?

Thank you