mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
feat(storage): read only transactions (#6417)
feat(storage): read only transactions for queries (#6415) * fix: tests * bastle wie en grosse * fix(database): scan as callback * fix tests * fix merge failures * remove as of system time * refactor: remove unused test * refacotr: remove unused lines
This commit is contained in:
@@ -67,9 +67,11 @@ func TestQueries_DeviceAuthByDeviceCode(t *testing.T) {
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
mock.ExpectBegin()
|
||||
mock.ExpectQuery(expectedDeviceAuthWhereDeviceCodeQuery).WillReturnRows(
|
||||
sqlmock.NewRows(deviceAuthSelectColumns).AddRow(expectedDeviceAuthValues...),
|
||||
)
|
||||
mock.ExpectCommit()
|
||||
q := Queries{
|
||||
client: &database.DB{DB: client},
|
||||
}
|
||||
@@ -86,9 +88,11 @@ func TestQueries_DeviceAuthByUserCode(t *testing.T) {
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
mock.ExpectBegin()
|
||||
mock.ExpectQuery(expectedDeviceAuthWhereUserCodeQuery).WillReturnRows(
|
||||
sqlmock.NewRows(deviceAuthSelectColumns).AddRow(expectedDeviceAuthValues...),
|
||||
)
|
||||
mock.ExpectCommit()
|
||||
q := Queries{
|
||||
client: &database.DB{DB: client},
|
||||
}
|
||||
@@ -133,6 +137,7 @@ func Test_prepareDeviceAuthQuery(t *testing.T) {
|
||||
return nil, true
|
||||
},
|
||||
},
|
||||
object: (*domain.DeviceAuth)(nil),
|
||||
},
|
||||
{
|
||||
name: "other error",
|
||||
@@ -148,6 +153,7 @@ func Test_prepareDeviceAuthQuery(t *testing.T) {
|
||||
return nil, true
|
||||
},
|
||||
},
|
||||
object: (*domain.DeviceAuth)(nil),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
Reference in New Issue
Block a user