selectOne method
Future<Map<String, dynamic> ?>
selectOne({
- required String sql,
- List parameters = const [],
- bool inlineBlobs = true,
- FbTransaction? inTransaction,
Utility method - selects a single row and reurns it as a map.
This method is a shortcut to obtaining a query, opening a cursor on the query with the given SQL statement, and fetching a single row. The row is returned as a map, with keys corresponding to column names, and values being the actual column values in the row. A FbQuery object is created internally and closed automatically when the query completes. The parameters are the same as in FbQuery.openCursor.
Implementation
Future<Map<String, dynamic>?> selectOne({
required String sql,
List<dynamic> parameters = const [],
bool inlineBlobs = true,
FbTransaction? inTransaction,
}) async {
final q = query();
try {
await q.openCursor(
sql: sql,
parameters: parameters,
inlineBlobs: inlineBlobs,
inTransaction: inTransaction,
);
return await q.fetchOneAsMap();
} finally {
await q.close();
}
}