whereIn<T extends Model> static method
Implementation
static Future<List<T>> whereIn<T extends Model>({required String column, required List<dynamic> values }) async {
final constructor = _jsonConstructors[T];
if (constructor == null) return [];
if (values.isEmpty) return [];
final sqliteDB = App().container.make<SQLiteDatabase>();
final tableName = Model.getTableName<T>();
// 1. Create placeholders: ?,?,?
final placeholders = List.filled(values.length, '?').join(',');
// 2. Fetch all matching rows in a single query
final List<Map<String, dynamic>> rows = await sqliteDB.query(
tableName,
where: '$column IN ($placeholders)',
whereArgs: values,
);
// 3. Transform raw maps into Model instances (Hydration)
// Replace 'fromMap' with whatever factory your framework uses
return rows.map((row) => constructor(row) as T).toList();
}