Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example for r2dbc connection URL #150

Closed
62mkv opened this issue Feb 27, 2020 · 5 comments
Closed

Add an example for r2dbc connection URL #150

62mkv opened this issue Feb 27, 2020 · 5 comments
Labels
type: documentation A documentation update

Comments

@62mkv
Copy link

62mkv commented Feb 27, 2020

it was really difficult to figure out proper H2 r2dbc URL for a "file" database.

Eventually it worked as follows:

r2dbc:h2:file://././build/h2db/db/dbname;DB_CLOSE_DELAY=-1;USER=username

can we add a section on this, because I could not find this information anywhere and had to debug ConnectionFactoryProvider

@mp911de
Copy link
Member

mp911de commented Feb 27, 2020

Sorry that you had a hard time figuring out how to construct the URL. Do you want to submit a pull request that explains H2 specifics when constructing an URL?

@62mkv
Copy link
Author

62mkv commented Feb 28, 2020

Hi Mark, thanks for this suggestion; I would gladly take this assignment however there're too many unknowns for me unfortunately. I am not even certain where to begin with that. For example, "r2dbc" URL parser seems to really demand a "schema", whereas in the H2 official URL (those are for jdbc, though) "schema" is mostly missing: http://www.h2database.com/html/features.html#database_url

also, I can't understand why first thing after schema is parsed as a "host", even though there's a "file" in it. If only I knew where to find the proper spec for an R2DBC H2 URL...

@mp911de
Copy link
Member

mp911de commented Feb 28, 2020

R2DBC H2 is basically a wrapper for H2 that attempts to bridge what H2 provides into the R2DBC world. The H2 documentation is really only a first starting point but it cannot cover how R2DBC URL's get built.

You might be interested in the general URL scheme: https://r2dbc.io/spec/0.8.1.RELEASE/spec/html/#overview.connection.url

Basically, URL's can contain the host part ("authority") (r2dbc:h2:tcp://remote-host/database) or they can be built without (r2dbc:h2:file:///absolute/file/path) depending on what you're trying to express. Getting feedback on the documentation and the idea how you approach configuration helps us to learn which aspects we can improve.

@mp911de mp911de added the type: documentation A documentation update label Feb 28, 2020
@katzyn
Copy link

katzyn commented Feb 28, 2020

file: in H2 is also optional and assumed by default, jdbc:h2:/path/to/database is a perfectly valid JDBC URL. It actually means the I/O method; there are others, such as async: and nioMapped:.

@62mkv
Copy link
Author

62mkv commented Feb 28, 2020

thanks, Mark! so basically my problem was that I was trying to refer to "relative" file path, and a leading "." was parsed as a "host", which lead to problems later.

So I had to begin the path with that "././" thing. It might even be a defect, not just a documentation missing.. I am not sure

mp911de added a commit that referenced this issue Mar 24, 2020
Add code of conduct and getting started section. Switch to TravisCI build badge. Add URL examples.

[resolves #150]
@mp911de mp911de changed the title add an example for r2dbc connection URL Add an example for r2dbc connection URL Mar 24, 2020
maxmin93 referenced this issue in maxmin93/agenspop-monitor May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

3 participants