simolus3 / drift

Drift is an easy to use, reactive, typesafe persistence library for Dart & Flutter.
https://drift.simonbinder.eu/
MIT License
2.66k stars 372 forks source link

Generated code throws issues when using certain type of Table names #3241

Closed av153k closed 1 month ago

av153k commented 1 month ago

Describe the bug

This might have been reported or might have been intentional but I noticed that generated code throws a lot of errors for a table with names corresponding to the below patterns.

If I named a table Addresses, the generated code breaks. (Basically a plural word that does not end in s but ends in es) If I named a table Addresss, the generated code breaks.

There might be more such examples to be made here.

simolus3 commented 1 month ago

Thanks for the report! I remember the issue, but I think this has been fixed in recent drift versions. Can you share which drift_dev version you're on?

av153k commented 1 month ago

Sorry for the late response. I am currently on drift_dev version 2.9.1. Should I upgrade to a newer version?

simolus3 commented 1 month ago

Yes, the fix is https://github.com/simolus3/drift/commit/29a30eb80796100ef73a1c15b2cea9d2ea361745 which has first been released with drift_dev version 2.20.0. Please let me know if you still run into this issue after upgrading.