Closed webleaf closed 5 years ago
Hey,
openrecord only uses a few build in nodejs modules like util
and events
. I've never worked with nativescript, but I'm sure that a polyfill oder other replacement lib for these exists.
However, for sql related stores, openrecord depends on knex - which has a lot more dependencies. But openrecord could be packaged via webpack. so theoretically it should be possible.
I'm currently polishing version 2, but after that I'll could try to build a small prototype with nativescript.
Still need this, because typeorm support imposes certain restrictions on the plugin installation.
When using with NativeScript, using webpack is compulsory. The typeorm/browser package is raw ES7 code with import/export which will NOT run as it is. It has to be bundled. Please use the tns run --bundle method
--bundle
option makes debugging less convenient.
Looks like we should implement Client for knex first. I'll try to do that.
Too many dependencies on node.
There are only a few DB methods returned by Database Object from Constructor in nativescript-sqlite plugin:
DB.isOpen() DB.execSQL() DB.get() DB.all() DB.each() DB.close() DB.resultType() DB.valueType()
https://github.com/NathanaelA/nativescript-sqlite/blob/master/src/README.md
Is it possible to implement store for this plugin? Does openrecord could work without nodejs (because NativeScript does not have it... only JS engine)?