- Preparing search index...
- The search index is not available
kysely
Interface ReturningInterface<DB, TB, O>
Methods
returning
- returning<SE>(selections): ReturningInterface<DB, TB, ReturningRow<DB, TB, O, SE>>
-
Type Parameters
-
SE extends string | AliasedExpression<any, any> | DynamicReferenceBuilder<any> | AliasedExpressionFactory<DB, TB>
Parameters
-
selections: readonly SE[]
Returns ReturningInterface<DB, TB, ReturningRow<DB, TB, O, SE>>
- returning<CB>(callback): ReturningInterface<DB, TB, ReturningCallbackRow<DB, TB, O, CB>>
-
Returns ReturningInterface<DB, TB, ReturningCallbackRow<DB, TB, O, CB>>
- returning<SE>(selection): ReturningInterface<DB, TB, ReturningRow<DB, TB, O, SE>>
-
Type Parameters
-
SE extends string | AliasedExpression<any, any> | DynamicReferenceBuilder<any> | AliasedExpressionFactory<DB, TB>
Returns ReturningInterface<DB, TB, ReturningRow<DB, TB, O, SE>>
Allows you to return data from modified rows.
On supported databases like PostgreSQL, this method can be chained to
insert
,update
anddelete
queries to return data.Note that on SQLite you need to give aliases for the expressions to avoid this bug in SQLite. For example
.returning('id as id')
.Also see the returningAll method.
Examples
Return one column:
Return multiple columns:
Return arbitrary expressions: