-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration fixture tests for sqlite
- Loading branch information
Showing
8 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
.../src/test/migration-interface-fixtures/alter-table-rename-column-sqlite/com/example/1.sqm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE TABLE test ( | ||
first TEXT NOT NULL | ||
); |
1 change: 1 addition & 0 deletions
1
.../src/test/migration-interface-fixtures/alter-table-rename-column-sqlite/com/example/2.sqm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE test RENAME COLUMN first TO alpha; |
6 changes: 6 additions & 0 deletions
6
...rc/test/migration-interface-fixtures/alter-table-rename-column-sqlite/com/example/Data.sq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
insert: | ||
INSERT INTO test (alpha) VALUES (?); | ||
|
||
select: | ||
SELECT * | ||
FROM test; |
27 changes: 27 additions & 0 deletions
27
...ion-interface-fixtures/alter-table-rename-column-sqlite/output/com/example/DataQueries.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.example | ||
|
||
import app.cash.sqldelight.Query | ||
import app.cash.sqldelight.TransacterImpl | ||
import app.cash.sqldelight.db.SqlDriver | ||
import kotlin.String | ||
|
||
public class DataQueries( | ||
driver: SqlDriver, | ||
) : TransacterImpl(driver) { | ||
public fun select(): Query<String> = Query(-1_042_942_063, arrayOf("test"), driver, "Data.sq", | ||
"select", """ | ||
|SELECT * | ||
| FROM test | ||
""".trimMargin()) { cursor -> | ||
cursor.getString(0)!! | ||
} | ||
|
||
public fun insert(alpha: String) { | ||
driver.execute(-1_320_712_882, """INSERT INTO test (alpha) VALUES (?)""", 1) { | ||
bindString(0, alpha) | ||
} | ||
notifyQueries(-1_320_712_882) { emit -> | ||
emit("test") | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
.../migration-interface-fixtures/alter-table-rename-column-sqlite/output/com/example/Test.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example | ||
|
||
import kotlin.String | ||
|
||
public data class Test( | ||
public val alpha: String, | ||
) |
4 changes: 2 additions & 2 deletions
4
...piler/src/test/migration-interface-fixtures/alter-table-rename-column/com/example/Data.sq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
insertWhole: | ||
insert: | ||
INSERT INTO test | ||
VALUES ?; | ||
VALUES ?; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters