Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnu-liguobin committed Jul 21, 2023
1 parent 457da73 commit cc1a4ae
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/resultset_x.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ val statement = DriverManager
.getConnection(
"jdbc:h2:mem:zim?caseSensitive=false;MODE=MYSQL;TRACE_LEVEL_FILE=2;INIT=RUNSCRIPT FROM 'classpath:test.sql'"
)
// rows is a Scala Tuple
val rows = ResultSetX[TypeRow4[Int, String, String, String]](sqlQ"select * from T_USER").fetch()
assert(rows.size == 2)
// Scala3 Tuple to List
assert(rows.head.values.size == 4)
val rs = ResultSetX[TypeRow4[Int, String, String, String]](sqlQ"select * from T_USER")
// rows is a Scala List[Tuple]
val rows: LazyList[TypeRow] = rs.fetch()
// get first column
val column1: Int = rows.head.columns[rs.Out]._1

// get all columns
val columns: LazyList[Any] = rows.head.lazyColumns
```

0 comments on commit cc1a4ae

Please sign in to comment.