bombillazo
Explore posts from serversKysely client usage and pooling question
Hello,
We have a long running server that at the moment creates a single Kysely instance. It is setup to use pg pooling. We have a util function called getKysely which returns this instance and is used throught our backend , like on every request handler that calls the DB. So in theory multiple concurrent requests call this function to get the Kysely client and make queries.
We are noticing that even within the same API endpoint handler, executing queries with a fetched client seems to be running on different connections. We think this because we sometimes execute raw sql queries which change the role of the connection, but later on using the same client we execute a query to check the current role and it is not the one set up previously.
I am curious about how Kysely internally uses pooling, does it fetch a connection from the pool on every query? I know we are using a singleton, but how can I make sure that Kysely uses a single connection throughout the scope of a single request?
7 replies
Reset position of terminal cursor when calling io.writeAllSync()
Currently using io.writeAllSync, the next data is written where the last data left off, even with a new line the cursor is kept horizontally in the position that was left.
I tried the ansi library cursorBack function but it did not work, how can I control or reset the cursor?
2 replies
Is there any way to force a Deno dependency to use a specific version of std?
We're having an issue were a dependency we are importing from npm with the
npm:
identifier is trying to use a node lib that only exisits up to std v0.177.0, specifically the tty
lib. Our main std version is in 0.244.0 specified in our import_map.json file.
Is there any way to specify this 3rd party dep to use the std version it requires to work?2 replies
Kysely setup in monolith API
Hello, we have a basic http server with a basic router and a PostgreSQL database. We're wondering what is the proper setup to use the Kysely client in our routes to make calls to the database. Should there be a singleton client that is used across routes, or do we need to instantiate a kysely client on every request ?
10 replies
Omit/filter out columns from query
Hey, is there an easy or convenient way with Kysely to filter out data from a query? Lets say I have columns 1,2,3,4,..., 10 and I want to omit column 9, do I have to really list all my columns like this:
?
11 replies
How to create a typed array of columns for select?
Hello, I am trying to create some helpers that contain the list of columns used by multiple queries, and I want to have them typed to the table they belong to to have it suggest errors if a table changes or someone uses a non-valid column. How is this achievable with the kysely helper types? The array may also include expression builder or the
jsonObjectFrom
helpers since they are valid Select options3 replies
Deno.Command output as it runs
Hello, I am trying to run a command and have its output be logged as it runs , but for some reason the command runs but no output is displayed. I tried using both ouput with await and outputSync, setting stdout to piped and inherit but nothing.
6 replies
RRefine
•Created by absent-sapphire on 12/14/2023 in #ask-any-question
What are the differences between the `useNotification` and `useHandleNotification` hooks?
Id like to know more about each hook and what are their different uses and purposes.
4 replies