diff options
-rw-r--r-- | src/main/kotlin/DatabaseController.kt | 26 |
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 } |