toTableList method

List<SqfEntityTableBase>? toTableList(
  1. List<DartObject> objTables,
  2. String dbModelName, {
  3. List<SqfEntityFieldType>? defaultColumns,
})

convert dartObject to SqfEntityTableBase

Implementation

List<SqfEntityTableBase>? toTableList(
    List<DartObject> objTables, String dbModelName,
    {List<SqfEntityFieldType>? defaultColumns}) {
  final retVal = <SqfEntityTableBase>[];
  //if (objTables != null) {
  print('SQFENTITY_GEN.DART: recognizing Tables ($dbModelName)');

  for (var obj in objTables) {
    //  print(   '-------------------------------------------------------ModelBuilder: ${getStringValue(obj, 'tableName')}');
    final table = toSqfEntityTable(
      obj,
      dbModelName,
      defaultColumns: defaultColumns,
    );
    if (retVal.where((t) => t.tableName == table!.tableName).isEmpty) {
      retVal.add(table!);
    }
  }
  //}
  return retVal;
}