PhilWaldmann / openrecord

Make ORMs great again!
https://openrecord.js.org
MIT License
486 stars 38 forks source link

NativeScript sqlite plugin support #61

Closed webleaf closed 5 years ago

webleaf commented 6 years ago

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)?

PhilWaldmann commented 6 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.

webleaf commented 6 years ago

Will be supported in the next release of typeorm

webleaf commented 5 years ago

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.

webleaf commented 5 years ago

Looks like we should implement Client for knex first. I'll try to do that.

webleaf commented 5 years ago

Too many dependencies on node.