bind
Binds a literal value using ? to this column.
This function is used to associate a specific value with a column, typically for operations like INSERT or UPDATE where you are providing the data to be written.
Underlying driver will use ? in query to bind the value safely.
Example
Artists.quickInsert {
it.artistId.bind(1)
it.artistName.bind("SuperCoolMan")
}Parameters
The value to bind to the column. The type of the value must match the column's type T.
Type Parameters
The data type of the column and the value being bound.
Binds the value of another column or function to this column.
Example
Artists.quickInsert {
it.artistName.bind(UPPER(StringLiteral("SuperCoolMan")))
}Parameters
The column or function whose value should be bound to this column.
Type Parameters
The data type of the columns.
Binds an Int value to a column that accepts Long types.
This is a convenience function that allows binding an integer directly to a Long column, as this is a common and safe conversion in database operations.
Parameters
Binds a Float value to a column that accepts Double types.
This is a convenience function that allows binding a float directly to a Double column, as this is a common and safe conversion in database operations.
Parameters
Binds the result of a SelectStatement to this column.
This is typically used for subqueries within an INSERT or UPDATE operation, allowing the value of this column to be populated by the output of the provided select statement.
Example
Artists.quickInsert {
it.artistId.bind(2)
// Binds the name from another table using a subquery
it.artistName.bind(
OtherTable
.select(OtherTable.name)
.where { OtherTable.id eq 1 },
)
}Parameters
The select statement whose result will be bound to this column.