File tree 1 file changed +22
-0
lines changed
ktorm-core/src/main/kotlin/org/ktorm/schema 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
18
18
19
19
import java.math.BigDecimal
20
20
import java.sql.*
21
+ import java.sql.Array
21
22
import java.sql.Date
22
23
import java.time.*
23
24
import java.time.format.DateTimeFormatterBuilder
@@ -557,3 +558,24 @@ public object UuidSqlType : SqlType<UUID>(Types.OTHER, "uuid") {
557
558
return rs.getObject(index) as UUID ?
558
559
}
559
560
}
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