micronaut-projects / micronaut-projects/micronaut-sql

Pass all uknown parameters to jdbc url string

Open
#810 0 comments 0 reactions 0 assignees View on GitHub
type: enhancement type: question
Dominant language
Java
Stars
83
Forks
49
Avg merge
1d 10h
Merged PRs (30d)
22

Description

### Feature description

_Not sure if bug or feature_

I'm using hikari and postgresql. You can pass additional params via ugly jdbc URL:
```
datasources:
default:
url: jdbc:postgresql://localhost:5432/db?-c%20my.var=SOMEVAL%20-c%20pg_trgm.similarity_threshold=0.1
```
I assumed that I can do instead
```
datasources:
default:
url: jdbc:postgresql://localhost:5432/db
options: -c my.var=SOMEVAL -c pg_trgm.similarity_threshold=0.1
```
or even better
```
datasources:
default:
url: jdbc:postgresql://localhost:5432/db
options:
- -c my.var=SOMEVAL
- -c pg_trgm.similarity_threshold=0.1
```
and all unknown params will be url encoded and attached to jdbc url but It doesn't work.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how datasources.default.options is bound and how the Hikari JDBC URL is assembled; inspect existing datasource configuration tests. Done means unknown options are URL-encoded and appended to the PostgreSQL JDBC URL, including both the scalar and list forms shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.