'Flutter Drift(Moor): concat two columns

I have a Table called Contracts:

class Contracts extends Table {
  TextColumn get firstName => text().named('firstname')();

  TextColumn get lastName => text().named('lastname')();

  // some more columns
}

In a View, I want to concatenate both columns to one like in SQL:

firstname || ' ' || lastname as name
abstract class Bookings extends View {
  Contracts get c;
  @override
  Query as() => select([
    // firstname || ' ' || lastname as name, // what do I have to do here?
    // more stuff 
  ]).from(c);
}

But I can't find any method or class or whatever to do that. And I also didn't find any examples on the internet.



Solution 1:[1]

The author of the lib gave me the answer, see: https://github.com/simolus3/moor/discussions/1691#discussioncomment-2197504

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ralph Bergmann