sql

2024-06-22T23:09:37.999249Z

What is the proper way to set the builder-fn when using hikari-cp with next.jdbc? I am trying to set it to use as-unqualified-maps but just can't seem to get it to work.

seancorfield 2024-06-22T23:11:04.638759Z

No need to use hikari-cp - next.jdbc supports Hikari out of the box, no wrapper needed.

seancorfield 2024-06-22T23:12:42.482659Z

Make a connection pooled data source. Use with-options to wrap it if you want global options baked in (but I don't recommend that - I recommend using the default and just getting used to qualified keywords).

seancorfield 2024-06-22T23:14:13.003089Z

If that doesn't help, you'll need to share code to show folks what you're trying, and be more specific about "doesn't work" 😁

2024-06-23T20:38:44.884209Z

Yeah I am using ->pool and I tried wrapping the pool call and get-connection calls using with-options, but when I do that I get an error saying "No matching field found: close for class next.jdbc.default_options.DefaultOptions".

2024-06-23T20:42:34.014699Z

Also, i'm curious what your reasoning is for recommending qualified keywords is that just to avoid conflicts? I don't like how verbose it would make all the keyword map accesses.

seancorfield 2024-06-23T20:48:05.990299Z

They're idiomatic. You can use aliases and/or destructuring to make code shorter. But, frankly, I think they help clarify the code and don't really add much burden, especially when your editor can provide auto-suggest for keywords. As for your errors, I'd have to see code to help more.

2024-06-23T21:02:55.766209Z

It seems the error is coming from use of with-open should I still be using that even when using a connection pool?

2024-06-23T21:06:07.999689Z

And yeah I know there are idiomatic, that is why I think I should look into them further. I just know it would be a mess to migrate over to using them now on our project since its quite big and would break in many places. We have a full test suite but still would be quite the migration. Not sure it would be worth it for us at this time.

seancorfield 2024-06-23T21:08:39.232469Z

with-open is fine with get-connection with Hikari. We use that all the time at work. As I said, without seeing code, I can't tell what you're doing wrong.