exec method

PqResult exec(
  1. String query, {
  2. Allocator allocator = ffi.malloc,
})

Excecute a sql query Example:

  final result = pq.exec('SELECT * from pg_catalog.pg_user limit 1');
  print(result.asMapList());
  result.dispose();

Implementation

PqResult exec(String query, {Allocator allocator = ffi.malloc}) {
  final queryP = query.toNativeUtf8(allocator: allocator);
  final resultP = pq.PQexec(conn, queryP.cast());
  final result = PqResult(this, resultP, query);

  //
  allocator.free(queryP);
  return result;
}