Hey, I got xata working with kysely on

Hey, I got xata working with kysely on cloudflare workers, but I've got few questions. On cloudflare you're supposed to create new instance (db connection) every time function is evoked. Kysely docs state that you should destroy such instance, but your docs/example with cloudflare doesn't mention it. Does the client keep the connection open and should I destroy it? I guess the destroy function of kysely instance would free memory as well, but I think it's not relevant in case of cloudflare as the context is destroyed anyway after the function is finished.
3 Replies
tsg
tsg2mo ago
I think you shouldn't need it, it goes over HTTP so the connection is not a concern. @SferaDev correct me if I'm wrong please
SferaDev
SferaDev2mo ago
Yeah, connections in kysely are not long lived
brownfox.dev
brownfox.devOP2mo ago
Makes sense. Thank you guys
Want results from more Discord servers?
Add your server