Guidance to create a generic wrapper over Kysely
I am trying to create a generic authentication wrapper over Kysely. The idea is
- You can pass some config to this function, which includes a reference to
- The function will return an authenticator instance you can use to perform user lookups during Login. The internals of this function are not important for this discussion.
This is what I have so far. You can copy/paste the following code to run it yourself.
The
So, I need some guidance on which approach to take for this use case.
- You can pass some config to this function, which includes a reference to
Kysely instance, a database table name and an array of column names.- The function will return an authenticator instance you can use to perform user lookups during Login. The internals of this function are not important for this discussion.
This is what I have so far. You can copy/paste the following code to run it yourself.
The
.where(config.uids[0]) method call gives a type error saying, "The Columns are not assignable to the input accepted by the where method".So, I need some guidance on which approach to take for this use case.