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 the uuid() function #14

Open
klacointe opened this issue Nov 16, 2018 · 1 comment
Open

How to use the uuid() function #14

klacointe opened this issue Nov 16, 2018 · 1 comment

Comments

@klacointe
Copy link

Il tried to use the uuid() function to generate unique UUID:

Event
|> insert(event_id: "uuid()")
|> if_not_exists
|> Event.save()

But I received this error: Invalid STRING constant (uuid()) for "event_id" of type uuid"

@RuslanMykulyn
Copy link

Hello,
use UUID hex library :) and don't forget to convert it to char list.
user_id = UUID.uuid4() |> String.to_charlist()

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

No branches or pull requests

2 participants