我有一个表叫Contracts
:
class Contracts extends Table {
TextColumn get firstName => text().named('firstname')();
TextColumn get lastName => text().named('lastname')();
// some more columns
}
在View中,我想将两列连接到 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);
}
但我找不到任何方法或类或其他任何方法。而且我在互联网上也没有找到任何例子。