query method

FbQuery query()

Creates a new query object associated with this connection.

Creating a query object of itself does not interact with the database in any way. Only after calling FbQuery.execute or FbQuery.openCursor the actual SQL statement gets executed. However, to execute a statement, first you need a valid FbQuery object, associated with an active database attachment.

Example:

final db = await FbDb.attach(host: "localhost", database: "employee");
final q = db.query(); // note: no await here
// work with the query
await q.close(); // close the query
// query object can still be used after close
// e.g. to execute another SQL statement
await db.detach(); // detach from the database
// db cannot be used any more

Implementation

FbQuery query() {
  return FbQuery.forDb(this);
}