Replies: 4 comments 1 reply
-
@harikvpy yes you need to close the connection do the importFromJson and create a new connection this is the process flow |
Beta Was this translation helpful? Give feedback.
-
Is this mentioned in the docs? May be it is, but I couldn't find it. If it isn't, it'll be nice to include it with a small code sample. |
Beta Was this translation helpful? Give feedback.
-
@harikvpy you right, it is not clearly mentioned in the ImportExportJSON doc but if you look at the example in the link given solide-vite-sqlite-app you will see that the connection is close prior to use the importFromJson method. I will make it clear in the doc |
Beta Was this translation helpful? Give feedback.
-
I guess I was looking at the wrong samples. I downloaded https://github.com/jepiqueau/blog-tutorials-apps.git and searched for |
Beta Was this translation helpful? Give feedback.
-
I have a database service that keeps a connection to the database open in its
init()
method like this:sqliteService
is an instance of theSQLiteService
from the sample code.What I find is that if you don't close this database and its connection,
importFromJson()
doesn't work. Especially when testing on a desktop with Jeep-sqlite. So what I do isand then call
importFromJson()
and then reopen the database.Is this the correct approach? Is there anything that I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions