-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup embeddable database #19
Comments
Seems like there is libraries for cross database: https://lib.haxe.org/t/database/ |
It seems like I can create an internal database and object relational mapping. The haxlib has is updated and has many downloads: https://github.com/HaxeFoundation/record-macros |
It seems bit completed to work with orm, and running the sample code resulted in errors. This the following json db haxelib seem to be simple to work with, and it says it works on all Sys targets. |
I will setup the db and make a test on a Xamarin Forms android device. And on cocoa I will run it on watchOS os via Xcode in the way that the watchOSDummySample was made with haxe-c-bridge |
Then I will have to structure the data in a good way |
It does not seem like in an agnostic file path can be made unless creating in memory db. I think it should be possible to read the shipped db as resources (json) and create a in memory db out of it, to use in the search in the client. This means it can't permanently written to at runtime, but I don't that would be advisable to do any way. Here is a sketch: The in memory db is created at runtim - using it for search of categorical tags. The resources should be created when building the library and tags are assembled I will see if in memory reading from resource works in dotnet target and cocoa (via haxe-c-bridge) |
I choose to go with sqlite. Since multiple .db files are needed for specifying language - I will be looking to see if it is possible to read and write persistent (disk saved) database files in haxe, and test in Xamarin Forms on android, and in cocoa for apple watch. |
The path needs to given from the client, here is docs with xamarin: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/data/databases There should be something similar in swift (cocoa) for watchOS, probably NSPersistentContainer. I needed to update my apple watch to test it out more. I will setup a test method which writes the |
Setup SQLite in Haxe
As I want the search to be embeddable in the client I need to setup a working database interaction. SQLite exists in the Sys package in haxe, and Open Street Map has it's data in it.
However since my primary target now being .net - it is unclear how to set up the needed driver: https://community.haxe.org/t/sqlite-in-c-target/3270/2 I will use a .net standard nuget package with SQLite driver and functionality init.
For other targets like cocoa I would use the C++ driver and set it up later.
Using haxe means I can have shared resources. But is a bit unclear what the path to
.db
would be.Also it can be seen as a separate project to create cross platform embeddable db as a haxelib. It could depend on native packages and/or native drivers. Then set up in way the client/developer can read and write any data to it.
It needs to be assured also that the data is persistent between app start, on mobile for instance...
The text was updated successfully, but these errors were encountered: