apply method

Future<void> apply(
  1. DbContext dbc
)
executes to the database without committing

Implementation

Future<void> apply(DbContext dbc) async {
  for (DbObject dbo in _objects) {
    try {
      await dbc.create(dbo);
    } catch (error) {
      if(error.toString().contains('duplicate column name'))
        continue;
    }
  }
  //
  for (NonQueryStatement st in _statements) {
    await st.execute(dbc);
  }
  //
  for (String sql in _rawSql) {
    await dbc.executeSql(sql);
  }
}