Support and default to UUID for PostgreSQL uuid#262
Open
Conversation
Comment on lines
+1422
to
+1424
| @testset "UUID" begin | ||
| tests = ( | ||
| ("'6dc2b682-a411-a51f-ce9e-af63d1ef7c1a'::uuid", UUID("6dc2b682-a411-a51f-ce9e-af63d1ef7c1a")), |
Contributor
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
Suggested change
| @testset "UUID" begin | |
| tests = ( | |
| ("'6dc2b682-a411-a51f-ce9e-af63d1ef7c1a'::uuid", UUID("6dc2b682-a411-a51f-ce9e-af63d1ef7c1a")), | |
| @testset "Parameters" begin | |
| conn = LibPQ.Connection( | |
| "dbname=postgres user=$DATABASE_USER"; throw_error=true |
Comment on lines
+1427
to
+1430
| @testset for (pg_str, obj) in tests | ||
| result = execute(conn, "SELECT $pg_str = \$1", [obj]) | ||
| @test first(first(result)) | ||
| close(result) |
Contributor
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
Suggested change
| @testset for (pg_str, obj) in tests | |
| result = execute(conn, "SELECT $pg_str = \$1", [obj]) | |
| @test first(first(result)) | |
| close(result) | |
| @testset "UUID" begin | |
| tests = (( | |
| "'6dc2b682-a411-a51f-ce9e-af63d1ef7c1a'::uuid", | |
| UUID("6dc2b682-a411-a51f-ce9e-af63d1ef7c1a"), | |
| ),) | |
| @testset for (pg_str, obj) in tests | |
| result = execute(conn, "SELECT $pg_str = \$1", [obj]) | |
| @test first(first(result)) | |
| close(result) | |
| end |
| @test first(first(result)) | ||
| close(result) | ||
| end | ||
| end |
Contributor
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
Suggested change
| end |
|
Seems to work well. Can it be merged? |
Contributor
|
LGTM, reminder to bump the minor release. I'm inclined to holdoff on changing the String fallback for now. Might want to make an issue for it though? |
rofinn
approved these changes
Feb 14, 2023
|
Good to merge? |
Contributor
|
No, this MR needs a rebase before we can proceed. |
|
Rebased: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #260
This adds binary format parsing for UUID and sets the default Julia type for PostgreSQL's
uuidtoBase.UUID. The import relies on the UUIDs stdlib export for stability's sake.Array support was easy enough to add as well.
Open question on whether changing the default type away from the
Stringfallback needs a major version update: https://discourse.julialang.org/t/anyone-fetching-uuids-using-libpq-jl/89395/3I think if people conclude it does, I'll change to ensure this doesn't set the default but still supports the same operations when UUID is specified.