Skip to content

Conversation

@nick318
Copy link
Contributor

@nick318 nick318 commented Oct 7, 2022

As said in the https://www.postgresql.org/docs/current/functions-uuid.html default function to generate UUID in postgres is gen_random_uuid. It would be convenient to have an alias of the function in h2.

@sonatype-lift
Copy link
Contributor

sonatype-lift bot commented Oct 7, 2022

⚠️ 221 God Classes were detected by Lift in this project. Visit the Lift web console for more details.

@katzyn
Copy link
Contributor

katzyn commented Oct 8, 2022

Thank you for your contribution!

Please, move this function to org.h2.mode.FunctionsPostgreSQL and remove it from the main documentation.

It doesn't need any specialized implementation and should be replaced with built-in function during optimization, see FunctionsMSSQLServer.NEWID for example.

@nick318 nick318 force-pushed the add-random-uuid-alias branch from 6350560 to f467dd6 Compare October 8, 2022 09:14
@nick318
Copy link
Contributor Author

nick318 commented Oct 8, 2022

@katzyn Thanks for the review. I've made an update.

@katzyn
Copy link
Contributor

katzyn commented Oct 8, 2022

Please, add a test case to h2/src/test/org/h2/test/scripts/functions/numeric/random-uuid.sql somewhere before SET MODE Regular.

Please also send a license statement as described here
https://h2database.com/html/build.html#providing_patches
to our mailing list:
https://groups.google.com/g/h2-database
(It is partially pre-moderated, some new messages will be visible only after approval.)

@nick318
Copy link
Contributor Author

nick318 commented Oct 8, 2022

@katzyn done

@katzyn katzyn merged commit 15c5a7a into h2database:master Oct 9, 2022
@katzyn
Copy link
Contributor

katzyn commented Oct 9, 2022

Thanks!

@nick318 nick318 deleted the add-random-uuid-alias branch October 9, 2022 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants