EQ

infix fun <T> KQLiteColumn<T>.EQ(value: T): Clause.Expression

Creates an equality comparison expression (= or IS).

This infix function compares the column to a specified value. It intelligently uses IS for null comparisons and = for all other values, which is the standard SQL behavior for checking equality with NULL.

Example

// Generates: "age" = 25
Employees.age EQ 25

// Generates: "manager_id" IS NULL
Employees.managerId EQ null

Return

An Expression representing the equality condition.

Author

MOHAMMAD AZIM ANSARI

Parameters

value

The value to compare the column against. This can be null.

See also


infix fun <T> KQLiteColumn<T>.EQ(value: KQLiteColumn<out T>): Clause.Expression

Creates an equality comparison expression (=) between two columns.

This infix function compares the current column with another column, generating a SQL condition like "column_a" = "column_b". This is useful for joining tables or comparing related fields within the same table.

Example

// Generates: "employees"."manager_id" = "managers"."id"
Employees.managerId EQ Managers.id

Return

An Expression representing the column-to-column equality condition.

Author

MOHAMMAD AZIM ANSARI

Parameters

value

The KQLiteColumn to compare against.


infix fun KQLiteColumn<*>.EQ(selectStatement: SelectStatement<*>): Clause.Expression

Creates an equality comparison expression (=) between a column and a subquery.

This infix function checks if the value of the column is equal to the single result returned by the provided SelectStatement. The subquery should return a single column and at most one row.

Example

Tracks
.select()
.where {
it.bytes EQ Tracks.select(MAX(Tracks.bytes))
}
.execute(con)

Return

An Expression representing the column-to-subquery equality condition.

Author

MOHAMMAD AZIM ANSARI

Parameters

selectStatement

The subquery to compare against. It must be a scalar subquery.