vertx-kuickstart-core / dev.fuelyour.vertxkuickstartcore.repositories / InsertQuery

InsertQuery

interface InsertQuery<T : Any, R : Any>

Simple mixin query for inserting a single row into a given table. The default implementation can be used with a call to the impl function, or a different implementation may be provided.

Functions

insert

abstract suspend fun insert(toInsert: T, connection: SqlClient): R

Companion Object Functions

impl

Provides the default implementation for InsertQuery. Can be used as follows. Note that constant values should be passed for schema and table, as doing otherwise would risk sql injection.

fun <T : Any, R : Any> impl(schema: String, table: String): InsertQuery<T, R>

Inheritors

InsertQueryImpl

The default implementation for InsertQuery. It inserts a single row into the table.

class InsertQueryImpl<T : Any, R : Any> : InsertQuery<T, R>, Serializer, Deserializer