Generic base repository abstract class
So, I’m trying to create a base repository class to extend based on my schema definitions, thing is I’m having trouble getting the types to work, here is my example
8 Replies
It looks like it should work but I get the following error in the
this.table
when creating the select
Also for reference, this is how I’m getting the DB and DBTransaction types
Any clues or examples on how to achieve this?Hey! I'm experiencing the same type issue, did you manage to solve this?
Check out my comments and the dump I mentioned here - https://discord.com/channels/1043890932593987624/1392559056572645388/1393275780330426450
I generally do this:

@dfrn That's good for the base client type, but I think the problem is more surrounding the type to use for
TTable
.I still have to use my own
Tbl*
types shown here if I switch to that DrizzleClientType definition which is shown here as the DbClient
type and modified for Neon
postgres (see attached).The point being, I still have to do 2 casts here, one for the table and one for the result.
Not sure if this is what you are looking for. https://discord.com/channels/1043890932593987624/1372028149121945641/1372376611651059803 but that is what I needed in this thread