adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

Support for Knex.js

Open mlevit opened this issue 3 years ago • 3 comments

Describe the problem feature solves Support for https://knexjs.org/ on top of Sequilize and TypeORM. https://bookshelfjs.org/ runs on top of Knex and provides ORM capabilities.

Describe the solution you'd like Ability to use models created using Knex.

Describe alternatives you've considered Nothing else.

Acceptance criteria Ability to point AdminBro at Knex models to create admin console.

mlevit avatar Oct 29 '21 02:10 mlevit

You should probably throw ObjectionJS in there along with it. It's widely used in the HapiJS space.

damusix avatar Nov 29 '21 18:11 damusix

Maybe this is useful for you, I've made my own resource for ObjectionJS / Knex, mine is pretty simple and obviously could be improved but it works perfectly:

https://github.com/damian-pastorini/reldens/tree/37abbc8ddde86e5b515ad1570ff0900243663a39/packages/admin/server

https://github.com/damian-pastorini/reldens/blob/37abbc8ddde86e5b515ad1570ff0900243663a39/packages/admin/server/objection-driver-resource.js

The version is not the latest because I also wanted to make my app accept multiple drivers so I've ended up with these: https://github.com/damian-pastorini/reldens-storage/tree/v0.10.0-beta.23/lib

damian-pastorini avatar Dec 03 '21 19:12 damian-pastorini

I made an adapter that doesn't need ORM. Check out adminjs-sql. It uses Knex and fetch schema from INFORMATION_SHCEMA.

wirekang avatar Sep 08 '22 13:09 wirekang

There's currently an adapter for Objection which uses Knex internally, there's also an unofficial adapter made by @wirekang for MySQL. I'll close this issue as Bookshelf's adapter is not planned to be implemented in near future.

dziraf avatar Dec 21 '22 11:12 dziraf