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

ulid :id, auto_generate: false raises ULID::Rails::ArgumentError when id is generated by a DB function #69

Open
matas-zanevicius opened this issue Feb 6, 2024 · 0 comments

Comments

@matas-zanevicius
Copy link

Hi, I'm experimenting with the gem, I find it interesting. However, I have some concerns.
I have a pqsl function generate_ulid() which generates ulid ids by default.
The app that creates those records is not AR, and relies on DB function to generate ulid ids.

In Rails app on the model for the same table I configured id column not to auto_generate. When creating a record, it raises is not a ULID format on a BYTEA value e.g. \x018d7baa2b659d7042f45c3ab047c082.

While debugging, I noticed that when creating a record with ulid-rails valid_ulid? is called 11 times. Some room for improvement...

Also, optimisation-wise, do you think I should implement ulid generation with ruby code on the other app, or fix the issue here?

I'd be happy to contribute, just want your advice here as well ;)

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

1 participant