You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drift automatically infers the name of the corresponding entity companion objects by dropping the plural "s" suffix of the table name. However, this does not work correctly when the table name ends on "ies". In my case, I would like the companion object for my "categories" table to be called "CategoryCompanion", but it is called "CategorieCompanion".
Would it make sense to implement this simple pattern matching? I understand that there are reasons not to do it, as you might have tables containing proper names that end on "ie" and cannot be declined, or as someone might use table names in a foreign language where this rule does not apply. Maybe there could be an option to turn it on or off.
If I want to correct this mistake manually, from my understanding I need to use the @DataClassName annotation when using Table classes. Is there a way to do the same thing when using SQL files to generate my tables?
The text was updated successfully, but these errors were encountered:
Do you have the use_data_class_name_for_companionsbuilder option enabled? I think the default name for the companion class would be CategoriesCompanion otherwise. Not exactly what you were looking for, but also not as bad as the current situation.
Is there a way to do the same thing when using SQL files to generate my tables?
Sure, you can use AS RowClassName at the end of your table definition, so something like CREATE TABLE categories (...) AS Category should work.
Drift automatically infers the name of the corresponding entity companion objects by dropping the plural "s" suffix of the table name. However, this does not work correctly when the table name ends on "ies". In my case, I would like the companion object for my "categories" table to be called "CategoryCompanion", but it is called "CategorieCompanion".
Would it make sense to implement this simple pattern matching? I understand that there are reasons not to do it, as you might have tables containing proper names that end on "ie" and cannot be declined, or as someone might use table names in a foreign language where this rule does not apply. Maybe there could be an option to turn it on or off.
If I want to correct this mistake manually, from my understanding I need to use the @DataClassName annotation when using Table classes. Is there a way to do the same thing when using SQL files to generate my tables?
The text was updated successfully, but these errors were encountered: