register<T extends TableColumn> static method
Future<bool>
register<T extends TableColumn>(
- List<
T> fields, { - required TranscationalExecutor executor,
- String? tableName,
- OnMigrate? onMigrate,
Implementation
static Future<bool> register<T extends TableColumn>(List<T> fields, {required TranscationalExecutor executor, String? tableName, OnMigrate? onMigrate}) async {
assert(fields.isNotEmpty);
if (TableProto.isRegisted<T>()) return false;
final tab = TableProto._(fields, type: T, name: tableName, executor: executor);
if (onMigrate != null) {
await executor.transaction((e) async {
await onMigrate.migrate(e, tab);
});
}
return true;
}