aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclimb2019-04-04 20:18:45 +0200
committerclimb2019-04-04 20:18:45 +0200
commitf1ccafbbf03a4fdb8987303afa516a9fa5e2ea3d (patch)
treebb156a2997b232360f7670bbdf8d93f48ee62a37
parentb1ac24f50f50e6c61b5378968d9363a4df07680b (diff)
Added createUser function in DatabaseController
-rw-r--r--src/main/kotlin/DatabaseController.kt26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/kotlin/DatabaseController.kt b/src/main/kotlin/DatabaseController.kt
index 423dd05..d118b97 100644
--- a/src/main/kotlin/DatabaseController.kt
+++ b/src/main/kotlin/DatabaseController.kt
@@ -43,5 +43,31 @@ class DatabaseController(dbFileLocation: String = "main.db") {
}
}
+ fun createUser(uname :String, passwordHash :String) {
+ transaction {
+ UserData.insert {
+ it[username] = uname
+ it[password] = passwordHash
+ }
+ }
+ }
+
+ /*
+ fun selectUser(uname: String) :String {
+ var pwd :String
+
+ transaction {
+ UserData.select{UserData.username eq uname}.forEach {
+ pwd = it[UserData.password]
+ }
+ }
+
+ // return pwd
+ }
+
+ */
+
+
+
// TODO add functions for database usage
}