insertTopics method

Future<List<Map<String, dynamic>>> insertTopics(
  1. List<Map<String, dynamic>> rows
)

Insert topic rows in a single batch. Each map must include keys matching the topics table columns (id, domain_id, parent_topic_id, title, depth, sort_order). Returns the inserted rows.

Implementation

Future<List<Map<String, dynamic>>> insertTopics(
  List<Map<String, dynamic>> rows,
) async {
  final response = await _client.from('topics').insert(rows).select();
  return (response as List<dynamic>).cast<Map<String, dynamic>>();
}