0

我有一个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);
}

但我找不到任何方法或类或其他任何方法。而且我在互联网上也没有找到任何例子。

4

1 回答 1

0

lib的作者给了我答案,见: https ://github.com/simolus3/moor/discussions/1691#discussioncomment-2197504

于 2022-02-17T15:44:41.113 回答