Skip to content

Instantly share code, notes, and snippets.

View yat90's full-sized avatar

Yannic Abou-Taleb yat90

View GitHub Profile
@yat90
yat90 / jsonb.kt
Last active February 3, 2023 05:08
import com.google.gson.Gson
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.Function
import org.jetbrains.exposed.sql.statements.api.PreparedStatementApi
import org.postgresql.util.PGobject
fun <T : Any> Table.jsonb(name: String, klass: Class<T>, gson: Gson, nullable: Boolean): Column<T> {
return registerColumn<T>(name, JsonColumnType(klass, gson, nullable))
}