-
-
Save jdkula/648bd1c29d3b74797ce1fbd065781643 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import org.jetbrains.exposed.sql.Table | |
| object Games: Table() { | |
| val id = text("id").primaryKey().uniqueIndex() | |
| val location = text("location") | |
| val spy_player = integer("spy_player") | |
| val first_player = integer("first_player") | |
| val time_start = integer("time_started") | |
| val pause_time = integer("pause_time").nullable() | |
| } | |
| object Players: Table() { | |
| val id = integer("id").primaryKey().uniqueIndex().autoIncrement() | |
| val last_game = text("last_game").nullable() | |
| val expires_at = integer("expires_at") | |
| val name = text("name") | |
| } |
This file contains hidden or 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
| /* imports... */ | |
| def main(args: Array<String>) { | |
| Database.connect("jdbc:sqlite:test.sqlite3", "org.sqlite.JDBC") | |
| var userId: Int = -1 | |
| transaction(Connection.TRANSACTION_SERIALIZABLE, 2) { // <-- The failure below causes an AbstractMethodError here: Method org/sqlite/PrepStmt.isClosed()Z is abstract | |
| create(Games, Players) // <-- Fails here; no ResultSet returned, SQLException | |
| userId = Players.insert { | |
| it[name] = "test" | |
| it[expires_at] = 10 | |
| } get Players.id | |
| } | |
| println(userId) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment