我想在 Postgres 中使用表名,例如“TableName”。在 Aqueduct 中,建议的类名是 _tablename。
当我阅读手册时,我可以使用 @Table(name: "TableName") 但这似乎不起作用(或者可能没有正确理解)。
有没有办法在 Postgres 中使用不同的表名与 Aqueduct 中的私有类名?
@Table(name: "UserName")
class User extends ManagedObject<_User> implements _User {
@Serialize()
String get fullname => '$firstname $lastname';
@override
void willUpdate() {
// Add anything here to change prior to being updated.
}
@override
void willInsert() {
// Add anything here to change prior to being inserted.
}
}
class _User {
@primaryKey
int id;
@Column(nullable: false)
String firstname;
@Column(nullable: false)
String lastname;
@Column(nullable: false)
String email;
}