-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 access to the PostgREST version through SQL #2740
Conversation
Check #2647 (comment). It might not be necessary to mess with the conn URI. |
There's an issue with the env var approach on #2647 (comment). Also, seems osm2pgsql-dev/osm2pgsql#867 also adds the |
They don't use a URI connection string but a Key-Value one instead. Also they receive each connection parameter separately by the user (user, password, database, etc.) and then build the connstring themselves, so it's easier to add the fallback parameter there. |
Got it. We have it a bit more complicated. But we should be fine if we doctest(maybe io test too) our connstring mutation. |
666da0f
to
b62fc36
Compare
I need some confirmation in the way this feature behaves:
|
@laurenceisla Those are not problems IMO. This is just an extra nicety for debugging. We can document it's not reliable if there's no pg connection(and by default there will always be one bc of the listen channel). For 1, the user can do a distinct(#2647, this will be documented too). |
bb0c835
to
5a04ec7
Compare
I'm having a problem with the doctest. Running src/PostgREST/Config.hs:469: failure in expression `addPgrstVerToDbUri "postgres://user:pass@host:5432/postgres"'
expected: "postgres://user:pass@host:5432/postgres?fallback_application_name=PostgREST%20..."
but got:
^
<interactive>:27:1: error:
Variable not in scope: addPgrstVerToDbUri :: t0 -> t
Examples: 150 Tried: 147 Errors: 0 Failures: 1 But postgrest> test (suite: doctests)
Examples: 150 Tried: 150 Errors: 0 Failures: 0
postgrest> Test suite doctests passed
postgrest> test (suite: spec) |
@laurenceisla So the full error is:
See:
Seems the doctest environment can find |
Tried adding
But no dice |
e3e9bb0
to
fa20924
Compare
Fixed the doctests by making the |
src/PostgREST/Config.hs
Outdated
-- >>> let ver = "11.1.0 (5a04ec7)"::ByteString | ||
-- | ||
-- >>> addFallbackAppName ver "postgres://user:pass@host:5432/postgres" | ||
-- "postgres://user:pass@host:5432/postgres?fallback_application_name=PostgREST%20..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I've noticed these ...
work as a wildcard. Do you have a link for this behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, found it in their repo's README: https://github.com/sol/doctest#matching-arbitrary-output
bac41d3
to
262420a
Compare
cb1d0e5
to
7bfdb64
Compare
7f1507b
to
1e006e4
Compare
Closes #2647.