Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/ktorm.publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ publishing {
id.set("brohacz")
name.set("Michal Brosig")
}
developer {
id.set("csrawat")
name.set("Chandra Shekhar Rawat")
email.set("[email protected]")
}
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions ktorm-core/src/main/kotlin/org/ktorm/schema/SqlTypes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package org.ktorm.schema

import java.math.BigDecimal
import java.sql.*
import java.sql.Array
import java.sql.Date
import java.time.*
import java.time.format.DateTimeFormatterBuilder
Expand Down Expand Up @@ -557,3 +558,24 @@ public object UuidSqlType : SqlType<UUID>(Types.OTHER, "uuid") {
return rs.getObject(index) as UUID?
}
}

/**
* Define a column typed of [ArraySqlType].
*/
public fun BaseTable<*>.array(name: String): Column<Array> {
return registerColumn(name, ArraySqlType)
}

/**
* [SqlType] implementation represents `array` SQL type.
*/
public object ArraySqlType : SqlType<Array>(Types.OTHER, "array") {

override fun doSetParameter(ps: PreparedStatement, index: Int, parameter: Array) {
ps.setObject(index, parameter)
}

override fun doGetResult(rs: ResultSet, index: Int): Array? {
return rs.getObject(index) as Array?
}
}