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.
The author of the lib gave me the answer, see: https://github.com/simolus3/moor/discussions/1691#discussioncomment-2197504