indexFields method

  1. @override
Future<Set<String>> indexFields(
  1. String indexName
)
override

Implementation

@override
Future<Set<String>> indexFields(String indexName) async {
  String sql = '''
  SELECT a.attname AS field
  FROM pg_class c JOIN pg_attribute a ON a.attrelid = c.oid , pg_namespace as n
  WHERE n.nspname = ?
  AND c.relname = ?
  AND c.relnamespace = n.oid
  AND c.relkind ='i'
  AND a.attnum > 0
  ''';
  QueryResult r = await execute(sql, [schemaOrPublic, indexName]);
  return r.map((e) => e[0] as String).toSet();
}