fix(database): add Scan method to insert query interfaces

* Implement Scan method for BunInsertQuery, GormInsertQuery, and PgSQLInsertQuery
* Update mock implementations to support Scan method
* Introduce GetForeignKeyColumn utility for foreign key resolution
* Add tests for GetForeignKeyColumn functionality
This commit is contained in:
Hein
2026-05-18 12:04:50 +02:00
parent cb416d49c4
commit cd65946191
9 changed files with 371 additions and 52 deletions
+5
View File
@@ -239,6 +239,11 @@ func (m *MockInsertQuery) Exec(ctx context.Context) (common.Result, error) {
return args.Get(0).(common.Result), args.Error(1)
}
func (m *MockInsertQuery) Scan(ctx context.Context, dest interface{}) error {
args := m.Called(ctx, dest)
return args.Error(0)
}
// MockUpdateQuery is a mock implementation of common.UpdateQuery
type MockUpdateQuery struct {
mock.Mock