23template <DataMapperOptions QueryOptions,
typename Record>
27 [
this, &record]() -> RecordPrimaryKeyType<Record> { return Create<QueryOptions>(record); });
30template <
typename Record,
DataMapperOptions QueryOptions,
typename... PrimaryKeyTypes>
34 [
this, ... primaryKeys = std::move(primaryKeys)]() mutable -> std::optional<Record> {
35 return QuerySingle<Record, QueryOptions>(std::move(primaryKeys)...);
39template <
typename Record>
42 return Async::RunAsync(_connection.
AsyncBackend(), [
this, &record] { Update(record); });
45template <
typename Record>
48 return Async::RunAsync(_connection.
AsyncBackend(), [
this, &record]() -> std::size_t { return Delete(record); });
51template <
typename Record>
54 return Async::RunAsync(_connection.
AsyncBackend(), [
this, &record] { LoadRelations(record); });
Async::Task< void > LoadRelationsAsync(Record &record)
Asynchronously loads record's relations.
Async::Task< std::optional< Record > > QuerySingleAsync(PrimaryKeyTypes... primaryKeys)
Async::Task< void > UpdateAsync(Record &record)
Asynchronously updates record's modified fields.
Async::Task< RecordPrimaryKeyType< Record > > CreateAsync(Record &record)
Asynchronously inserts record, updating its primary key in place.
Async::Task< std::size_t > DeleteAsync(Record const &record)
Asynchronously deletes record.
LIGHTWEIGHT_API Async::IAsyncBackend & AsyncBackend()