sqlRunRead static method

Future<List<Map<String, dynamic>>> sqlRunRead({
  1. required Database db,
  2. required String tableName,
  3. String? where,
  4. String? orderBy,
  5. int? limit,
  6. int? offset,
})

Implementation

static Future<List<Map<String, dynamic>>> sqlRunRead({
  required sql.Database db,
  required String tableName,
  String? where,
  String? orderBy,
  int? limit,
  int? offset,
}) async {
  try {
    var data = await db.query(
      tableName,
      where: where,
      orderBy: orderBy,
      offset: offset,
      limit: limit,
    );
    if (data.isEmpty) return [];
    return data;
  } catch (e) {
    return [];
  }
}