select method

Future<MySqlResult> select(
  1. MySQLConnection conn,
  2. Sqler query
)

Executes a SELECT query on the table.

Executes the provided query to retrieve data from the table. The query should be constructed using the Sqler query builder.

Parameters:

  • conn - The active MySQL database connection
  • query - A Sqler object representing the SELECT query to execute

Returns a MySqlResult containing the query results and metadata.

Example:

var query = Sqler()
  ..from(QField('users'))
  ..selects([QSelect('*')])
  ..where(WhereOne(QField('active'), QO.EQ, QVar(true)));
var result = await table.select(conn, query);

Implementation

Future<MySqlResult> select(MySQLConnection conn, Sqler query) async {
  String sql = query.toSQL();
  return execute(conn, sql);
}