DatumRawQuery class

An adapter-aware raw query for projections, aggregations, and joins that bypass full entity hydration (#11).

Unlike DatumQuery (which returns hydrated entities), a raw query returns raw rows (List<Map<String, dynamic>>) so screens can select specific columns or compute COUNT/SUM/GROUP BY without materializing models.

It carries fields for both worlds; each adapter reads the ones it supports:

// Local SQL adapter (e.g. Drift/SQLite):
final rows = await manager.rawQuery(
  const DatumRawQuery(sql: 'SELECT id, name FROM users WHERE age > ?', args: [18]),
  source: DataSource.local,
);

// Remote adapter (e.g. Supabase/REST):
final rows = await manager.rawQuery(
  const DatumRawQuery(table: 'users', select: 'id, name', filters: {'age': {'gt': 18}}),
  source: DataSource.remote,
);

Constructors

DatumRawQuery({String? sql, List<Object?> args = const [], String? table, String? select, Map<String, dynamic>? filters, bool count = false, Map<String, dynamic> metadata = const {}})
const

Properties

args → List<Object?>
Positional arguments bound to sql placeholders.
final
count → bool
Whether this is a count aggregation (adapters return a single row).
final
filters → Map<String, dynamic>?
Structured filters for remote adapters (e.g. {'age': {'gt': 18}}).
final
hashCode → int
The hash code for this object.
no setterinherited
metadata → Map<String, dynamic>
Adapter-specific extra options (grouping, ordering, limits, …).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
select → String?
Column projection for remote adapters (e.g. 'id, name').
final
sql → String?
Raw SQL for local SQL adapters. Ignored by non-SQL adapters.
final
table → String?
Target table/collection for remote adapters.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited