@@ -1460,21 +1460,23 @@ class SelectQueryTypeTest {
1460
1460
1461
1461
assertThat(generator.function().toString()).isEqualTo(
1462
1462
"""
1463
- |public fun insertTwice(`value`: kotlin.Long) {
1464
- | transaction {
1465
- | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1466
- | |INSERT INTO data (value)
1467
- | | VALUES (?)
1468
- | ""${' "' } .trimMargin(), 1) {
1469
- | bindLong(0, value)
1470
- | }
1471
- | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1472
- | |INSERT INTO data (value)
1473
- | | VALUES (?)
1474
- | ""${' "' } .trimMargin(), 1) {
1475
- | bindLong(0, value)
1476
- | }
1477
- | }
1463
+ |/**
1464
+ | * @return The number of rows updated.
1465
+ | */
1466
+ |public fun insertTwice(`value`: kotlin.Long): app.cash.sqldelight.db.QueryResult<kotlin.Long> = transactionWithResult {
1467
+ | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1468
+ | |INSERT INTO data (value)
1469
+ | | VALUES (?)
1470
+ | ""${' "' } .trimMargin(), 1) {
1471
+ | bindLong(0, value)
1472
+ | }
1473
+ | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1474
+ | |INSERT INTO data (value)
1475
+ | | VALUES (?)
1476
+ | ""${' "' } .trimMargin(), 1) {
1477
+ | bindLong(0, value)
1478
+ | }
1479
+ |} .also {
1478
1480
| notifyQueries(-609_468_782) { emit ->
1479
1481
| emit("data")
1480
1482
| }
@@ -1511,21 +1513,23 @@ class SelectQueryTypeTest {
1511
1513
1512
1514
assertThat(generator.function().toString()).isEqualTo(
1513
1515
"""
1514
- |public fun insertTwice(value_: kotlin.Long, value__: kotlin.Long) {
1515
- | transaction {
1516
- | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1517
- | |INSERT INTO data (value)
1518
- | | VALUES (?)
1519
- | ""${' "' } .trimMargin(), 1) {
1520
- | bindLong(0, value_)
1521
- | }
1522
- | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1523
- | |INSERT INTO data (value)
1524
- | | VALUES (?)
1525
- | ""${' "' } .trimMargin(), 1) {
1526
- | bindLong(0, value__)
1527
- | }
1528
- | }
1516
+ |/**
1517
+ | * @return The number of rows updated.
1518
+ | */
1519
+ |public fun insertTwice(value_: kotlin.Long, value__: kotlin.Long): app.cash.sqldelight.db.QueryResult<kotlin.Long> = transactionWithResult {
1520
+ | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1521
+ | |INSERT INTO data (value)
1522
+ | | VALUES (?)
1523
+ | ""${' "' } .trimMargin(), 1) {
1524
+ | bindLong(0, value_)
1525
+ | }
1526
+ | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1527
+ | |INSERT INTO data (value)
1528
+ | | VALUES (?)
1529
+ | ""${' "' } .trimMargin(), 1) {
1530
+ | bindLong(0, value__)
1531
+ | }
1532
+ |} .also {
1529
1533
| notifyQueries(-609_468_782) { emit ->
1530
1534
| emit("data")
1531
1535
| }
@@ -1562,21 +1566,23 @@ class SelectQueryTypeTest {
1562
1566
1563
1567
assertThat(generator.function().toString()).isEqualTo(
1564
1568
"""
1565
- |public fun insertTwice(value_: kotlin.Long) {
1566
- | transaction {
1567
- | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1568
- | |INSERT INTO data (value)
1569
- | | VALUES (?)
1570
- | ""${' "' } .trimMargin(), 1) {
1571
- | bindLong(0, value_)
1572
- | }
1573
- | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1574
- | |INSERT INTO data (value)
1575
- | | VALUES (?)
1576
- | ""${' "' } .trimMargin(), 1) {
1577
- | bindLong(0, value_)
1578
- | }
1579
- | }
1569
+ |/**
1570
+ | * @return The number of rows updated.
1571
+ | */
1572
+ |public fun insertTwice(value_: kotlin.Long): app.cash.sqldelight.db.QueryResult<kotlin.Long> = transactionWithResult {
1573
+ | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1574
+ | |INSERT INTO data (value)
1575
+ | | VALUES (?)
1576
+ | ""${' "' } .trimMargin(), 1) {
1577
+ | bindLong(0, value_)
1578
+ | }
1579
+ | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1580
+ | |INSERT INTO data (value)
1581
+ | | VALUES (?)
1582
+ | ""${' "' } .trimMargin(), 1) {
1583
+ | bindLong(0, value_)
1584
+ | }
1585
+ |} .also {
1580
1586
| notifyQueries(-609_468_782) { emit ->
1581
1587
| emit("data")
1582
1588
| }
@@ -1613,21 +1619,23 @@ class SelectQueryTypeTest {
1613
1619
1614
1620
assertThat(generator.function().toString()).isEqualTo(
1615
1621
"""
1616
- |public fun insertTwice(value_: kotlin.Long, value__: kotlin.Long) {
1617
- | transaction {
1618
- | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1619
- | |INSERT INTO data (value)
1620
- | | VALUES (?)
1621
- | ""${' "' } .trimMargin(), 1) {
1622
- | bindLong(0, value_)
1623
- | }
1624
- | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1625
- | |INSERT INTO data (value)
1626
- | | VALUES (?)
1627
- | ""${' "' } .trimMargin(), 1) {
1628
- | bindLong(0, value__)
1629
- | }
1630
- | }
1622
+ |/**
1623
+ | * @return The number of rows updated.
1624
+ | */
1625
+ |public fun insertTwice(value_: kotlin.Long, value__: kotlin.Long): app.cash.sqldelight.db.QueryResult<kotlin.Long> = transactionWithResult {
1626
+ | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1627
+ | |INSERT INTO data (value)
1628
+ | | VALUES (?)
1629
+ | ""${' "' } .trimMargin(), 1) {
1630
+ | bindLong(0, value_)
1631
+ | }
1632
+ | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1633
+ | |INSERT INTO data (value)
1634
+ | | VALUES (?)
1635
+ | ""${' "' } .trimMargin(), 1) {
1636
+ | bindLong(0, value__)
1637
+ | }
1638
+ |} .also {
1631
1639
| notifyQueries(-609_468_782) { emit ->
1632
1640
| emit("data")
1633
1641
| }
@@ -1668,21 +1676,23 @@ class SelectQueryTypeTest {
1668
1676
1669
1677
assertThat(generator.function().toString()).isEqualTo(
1670
1678
"""
1671
- |public fun insertTwice(value_: kotlin.Long, value__: kotlin.Long) {
1672
- | transaction {
1673
- | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1674
- | |INSERT INTO data (value)
1675
- | | VALUES (?)
1676
- | ""${' "' } .trimMargin(), 1) {
1677
- | bindLong(0, value_)
1678
- | }
1679
- | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1680
- | |INSERT INTO data (value)
1681
- | | VALUES (?)
1682
- | ""${' "' } .trimMargin(), 1) {
1683
- | bindLong(0, value__)
1684
- | }
1685
- | }
1679
+ |/**
1680
+ | * @return The number of rows updated.
1681
+ | */
1682
+ |public fun insertTwice(value_: kotlin.Long, value__: kotlin.Long): app.cash.sqldelight.db.QueryResult<kotlin.Long> = transactionWithResult {
1683
+ | driver.execute(${query.idForIndex(0 ).withUnderscores} , ""${' "' }
1684
+ | |INSERT INTO data (value)
1685
+ | | VALUES (?)
1686
+ | ""${' "' } .trimMargin(), 1) {
1687
+ | bindLong(0, value_)
1688
+ | }
1689
+ | driver.execute(${query.idForIndex(1 ).withUnderscores} , ""${' "' }
1690
+ | |INSERT INTO data (value)
1691
+ | | VALUES (?)
1692
+ | ""${' "' } .trimMargin(), 1) {
1693
+ | bindLong(0, value__)
1694
+ | }
1695
+ |} .also {
1686
1696
| notifyQueries(${query.id.withUnderscores} ) { emit ->
1687
1697
| emit("data")
1688
1698
| }
0 commit comments