Replies: 1 comment 1 reply
-
Rodauth uses Sequel for database access, and Sequel doesn't have a mechanism similar to So currently, I don't think there is an easy way to support what you want. Rodauth is designed to work both with integer and UUID keys. If you were using PostgreSQL, there is an actual uuid type that stores in binary but uses text for input/output, so that would work without changes to Rodauth. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Rodauth Team,
First and foremost, I'd like to express my gratitude for developing Rodauth. Its ease of use and robustness have been greatly appreciated in my projects.
Background
Currently, I am developing a Rails application utilizing MySQL with Binary + ULID for generating unique identifiers. I am keen on implementing this ID format in the tables required by Rodauth as well, to maintain consistency throughout the application.
Challenge
However, I've encountered a challenge with Rodauth when adopting Binary + ULID. The direct use of Binary values for IDs leads to errors during transformations, such as when generating JWTs.
Proposal
In Rails, it's possible to declare a custom type via
ActiveRecord::Type::Binary
, which allows for altering the processing between the database andActiveRecord
during reads and writes, as demonstrated below:Does Rodauth have a mechanism for customizing ID reads and writes, similar to
ActiveRecord::Type
?Beta Was this translation helpful? Give feedback.
All reactions