mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 17:43:08 +00:00

This PR enhances error handling in the database package by introducing custom error types that wrap dialect-specific errors, providing better abstraction and context for error handling across the application. * Introduces standardized custom error types for common database errors (no rows found, integrity violations, etc.) * Wraps all PostgreSQL-specific errors at the dialect layer to provide consistent error handling # Which Problems Are Solved The database package didn't wrap the errors from dialect specifc packages. # How the Problems Are Solved Custom errors were added which wrap the dialect specifc errors. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
21 lines
337 B
Go
21 lines
337 B
Go
package repository
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/backend/v3/storage/database"
|
|
)
|
|
|
|
type repository struct {
|
|
client database.QueryExecutor
|
|
}
|
|
|
|
func writeCondition(
|
|
builder *database.StatementBuilder,
|
|
condition database.Condition,
|
|
) {
|
|
if condition == nil {
|
|
return
|
|
}
|
|
builder.WriteString(" WHERE ")
|
|
condition.Write(builder)
|
|
}
|