insert

context(context: QueryExecutor)
abstract suspend fun insert(entity: T): DbResult<T>(source)

Inserts the given entity into the data source using the specified driver context.

This method performs an asynchronous insert operation and returns the result. If the operation is successful, the result will contain the inserted entity. In case of failure, the result contains the error details.

Return

A DbResult containing the inserted entity of type T if the operation is successful, or an error if the operation fails.

Parameters

entity

The entity of type T to be inserted into the data source.