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

How to use UUID as primary key and return it #1036

Closed
chattago2002 opened this issue Jun 18, 2024 · 2 comments
Closed

How to use UUID as primary key and return it #1036

chattago2002 opened this issue Jun 18, 2024 · 2 comments

Comments

@chattago2002
Copy link

Hi everyone.

I'm trying to use UUIDv4 as "id" field (primary key). I set it as CHAR(36) and tha value is created via MySQL trigger "before insert". The value is set in the right way but it's not returned.

I read other issues here about this case but solutions seems not to work.

P.S. I would prefer to create UUIDv4 server-side and not client-side as written in some of the above mentioned issues.

@mevdschee mevdschee self-assigned this Jun 19, 2024
@mevdschee
Copy link
Owner

mevdschee commented Jun 19, 2024

I read other issues

Why are you opening a new one then?

The value is set in the right way but it's not returned.

Only auto increment values are returned.

I would prefer to create UUIDv4 server-side

Why? There is no technical reason to do so. UUID values can be generated decentralized, that's one of their advantages.

@mevdschee
Copy link
Owner

mevdschee commented Jun 19, 2024

See also #932 and #586 and especially:

#586 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants