File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
ktorm-core/src/main/kotlin/org/ktorm/schema Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package org.ktorm.schema
1818
1919import java.math.BigDecimal
2020import java.sql.*
21+ import java.sql.Array
2122import java.sql.Date
2223import java.time.*
2324import java.time.format.DateTimeFormatterBuilder
@@ -557,3 +558,24 @@ public object UuidSqlType : SqlType<UUID>(Types.OTHER, "uuid") {
557558 return rs.getObject(index) as UUID ?
558559 }
559560}
561+
562+ /* *
563+ * Define a column typed of [UuidSqlType].
564+ */
565+ public fun BaseTable <* >.array (name : String ): Column <Array > {
566+ return registerColumn(name, ArraySqlType )
567+ }
568+
569+ /* *
570+ * [SqlType] implementation represents `array` SQL type.
571+ */
572+ public object ArraySqlType : SqlType<Array>(Types .OTHER , " array" ) {
573+
574+ override fun doSetParameter (ps : PreparedStatement , index : Int , parameter : Array ) {
575+ ps.setObject(index, parameter)
576+ }
577+
578+ override fun doGetResult (rs : ResultSet , index : Int ): Array? {
579+ return rs.getObject(index) as Array?
580+ }
581+ }
You can’t perform that action at this time.
0 commit comments