drift
drift copied to clipboard
[Question] DataClass names
Hi!
If I have a table called Todos, Moor will generate a data class called Todo to represent my rows, but I already have a Todo data class that I've created to represent the todos in my project.
How can I change the generated Todo data class name to TodoRow?
If you are using moor files you can specify an "alias" at the end of your create table statement
CREATE TABLE (
...
) as TodoRow;
I'm using dart code.
The alias won't change only the table name?
Then you can do the following:
@DataClassName('TodoRow')
class Todos extends Table {
Check out the docs webpage. It has precisely an example of what you are asking ^^