Flutter Drift(Moor): concat two columns

689 Views Asked by At

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.

1

There are 1 best solutions below

1
Ralph Bergmann On