You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The advantage of this could potentially open up uses with other compatible packages or even developing adapter for other packages.
If this was possible, I could implement this narrow interface on my own, for example to implement better retry logic.
// pseudo-codeclassPoolWithRetryimplementsQueryable{connect(): Promise<any>{// own implementation}query(): Promise<any>{// own implementation}}
As a minimum, we could even just narrow the type by using Pick. But ideally, it should be more tightly defined, and only define the parts that zapatos needs.
I think this is a good idea in principle — I'd actually like to drop the direct pg dependency, so Zapatos can work with @neondatabase/serverless without any trickery.
But, as you say, distinguishing between a Client and a Pool in the transaction function is critical, and I'm not sure how we're going to do that in this case?
I propose that this package defines it's own
Queryable
rather than usingpg
built-ins:zapatos/src/db/core.ts
Line 206 in 157da6a
The advantage of this could potentially open up uses with other compatible packages or even developing adapter for other packages.
If this was possible, I could implement this narrow interface on my own, for example to implement better retry logic.
As a minimum, we could even just narrow the type by using
Pick
. But ideally, it should be more tightly defined, and only define the parts that zapatos needs.Additionally, this type of queryable detection will need a rework:
zapatos/src/db/transaction.ts
Lines 54 to 57 in 157da6a
Related: #77
The text was updated successfully, but these errors were encountered: