capacitor-community / sqlite

⚡Capacitor plugin for native & electron SQLite databases.
MIT License
501 stars 119 forks source link

Knex support for @capacitor-community/sqlite #270

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug This isn't really a bug, but it's not a feature request either.

I've created preliminary support for using @capacitor-community/sqlite with http://knexjs.org/

The typing isn't great because knex doesn't expose some of their types, and none of the drivers are themselves typed.

Here's the somewhat working implementation and example usage:

https://gist.github.com/jrobeson/788bfe6b97db45aa1535bf6897681b94

I'm not 100% sure I'll complete it since I still have some open questions about it, and it definitely requires some node polyfills.

One question is how I might handle migrations. I currently have them noop'ed in knex, but I know this module have some amount of support for migrations. I wonder if and how i can leverage it.

Either way, I wanted to share it in case folks were interested. I know you've done some work to make typeorm possible, but i much prefer https://mikro-orm.io/, and it requires knex, so I thought I'd give it a go.

jepiqueau commented 2 years ago

@jrobeson Any progress on this ? I close the issue feel free to re-open it if something new and interesting for the developer's community