CosmicMind / Graph

Graph is a semantic database that is used to create data-driven applications.
http://cosmicmind.com
MIT License
873 stars 72 forks source link

Migrate database from local to cloud with graph #142

Closed siideffect closed 6 years ago

siideffect commented 6 years ago

i would like to implement the cloud feature of graph. I ve searched on cosmicmind site, here on the repo (looking for wiki), and through the issues (closed). I have just learnt that feature is available, but i did not find any documentation.

Considering i am already using graph, in local:

let graph = Graph()
let entityPfx = "entityPfx"
let search = Search<Entity>(graph: graph).for(types: entityPfx)
let results = search.sync()

I would like users could retrieve data from the cloud in case of device upgrade or so. Is there any documentation available in order to implement this? Thank you.

Referring to https://stackoverflow.com/questions/48667199/migrate-database-from-local-to-cloud-with-graph

daniel-jonathan commented 6 years ago

Sorry for the delay. I will write you some details by Monday. Thank you!

siideffect commented 6 years ago

No problem. Glad you did not forget me, will wait for it.

siideffect commented 6 years ago

Hello, i have been able to use graph with cloud. The sync works good between my devices, but however, i still did not find a solution to "migrate" a local database declared as static var graph = Graph() to a cloud instance static var graphCloud = Graph(cloud: "DBonthecloud") Should i create a new cloud Instance, and add every single entity of my local instance of graph, to the cloud instance? What comes to my mind is launch a for loop to cycle over all records, and then call asyinc method on the cloud instance of graph to write the data, but im not sure about it.

daniel-jonathan commented 6 years ago

That is pretty much it. As well, you can create many cloud and local instances for your data. Sorry I didn't answer this earlier. I am going to close this issue, and if you have any further questions, please create a new one or reopen this one.

giuseppe69 commented 6 years ago

@siideffect hi, i'm following the tread because i have the same problem, could I ask you the way to sync with cloud using graph? thank you in advance for any answer.

daniel-jonathan commented 6 years ago

@giuseppe69 Hey! Are you looking for the direct code used?

giuseppe69 commented 6 years ago

Yes, because i don't find the documentation , i'm looking for some example

Il 15 mar 2018 19:50, "Daniel Dahan" notifications@github.com ha scritto:

@giuseppe69 https://github.com/giuseppe69 Hey! Are you looking for the direct code used?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CosmicMind/Graph/issues/142#issuecomment-373484749, or mute the thread https://github.com/notifications/unsubscribe-auth/AZWJ4NuxQuWMbLhNlVhW1t8jFsr7XTwrks5tergIgaJpZM4R-RRs .

daniel-jonathan commented 6 years ago

Let's move this conversation to https://gitter.im/CosmicMind/Graph and I can help you further.