-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently, users need to use two separate classes to instantiate routers for different database types. The API could be more made more unified and straightforward by creating a single entry point.
For example:
import {induct} from "@inductjs/core";
// Instantiate with new factory function
const inductRouter = induct({
db: knex, // auto detect mongo or knex connection object to return correct Induct class
schema: UserSchema,
tableName: "dbo.users", // make tableName required for sql instances
idField: "uuid", // extend possible id fields with "_id" for mongo instances
})
const router = inductRouter.default() // returns express router with default routes
// add other
router.get("/extra", someOtherHandler)
export default router;
Metadata
Metadata
Assignees
Labels
No labels