diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt index 1b580e8..5e40efb 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/dataaccess/SqliteBankingRepository.kt @@ -30,7 +30,7 @@ open class SqliteBankingRepository( val tanMethods = getAllTanMethods().groupBy { it.userId } val tanMedia = getAllTanMedia().groupBy { it.userId } - return userQueries.selectAllUsers { id, bankCode, loginName, password, bankName, bic, customerName, userId, selectedTanMethodIdentifier, selectedTanMediumIdentifier, bankingGroup, serverAddress, userSetDisplayName, displayIndex, iconUrl, wrongCredentialsEntered -> + return userQueries.selectAllUsers { id, bankCode, loginName, password, bankName, bic, customerName, userId, selectedTanMethodIdentifier, selectedTanMediumIdentifier, bankingGroup, serverAddress, userSetDisplayName, clientData, displayIndex, iconUrl, wrongCredentialsEntered -> UserEntity(id, bankCode, loginName, password, bankName, bic, customerName, userId, bankAccounts[id] ?: emptyList(), selectedTanMethodIdentifier, tanMethods[id] ?: emptyList(), selectedTanMediumIdentifier, tanMedia[id] ?: emptyList(), bankingGroup?.let { BankingGroup.valueOf(it) }, serverAddress, userSetDisplayName, displayIndex.toInt(), iconUrl, wrongCredentialsEntered) }.executeAsList() @@ -40,7 +40,7 @@ open class SqliteBankingRepository( return userQueries.transactionWithResult { userQueries.insertUser(user.bankCode, user.loginName, user.password, user.bankName, user.bic, user.customerName, user.userId, user.selectedTanMethodIdentifier, user.selectedTanMediumIdentifier, - user.bankingGroup?.name, user.serverAddress, user.userSetDisplayName, user.displayIndex.toLong(), user.iconUrl, user.wrongCredentialsEntered + user.bankingGroup?.name, user.serverAddress, null, user.userSetDisplayName, user.displayIndex.toLong(), user.iconUrl, user.wrongCredentialsEntered ) val userId = getLastInsertedId() // getLastInsertedId() / last_insert_rowid() has to be called in a transaction with the insert operation, otherwise it will not work diff --git a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq index ef9b881..5a57a72 100644 --- a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq +++ b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/User.sq @@ -20,6 +20,8 @@ CREATE TABLE IF NOT EXISTS User ( bankingGroup TEXT, serverAddress TEXT, + clientData TEXT, + userSetDisplayName TEXT, displayIndex INTEGER NOT NULL, @@ -44,6 +46,8 @@ INSERT INTO User( bankingGroup, serverAddress, + clientData, + userSetDisplayName, displayIndex, iconUrl, @@ -58,8 +62,13 @@ VALUES( ?, ?, ?, + + ?, + ?, ?, - ?, ? + + ?, + ? );