Documentation
¶
Index ¶
- Constants
- func InitTables(logger *slog.Logger, db *sqlx.DB, ves ...api.Entity) error
- func IsErrorCode(err error, errcode pqerror.Code) bool
- func MigrateDB(log *slog.Logger, db *sqlx.DB, healthServer *health.Server) error
- func New[E api.Entity](logger *slog.Logger, db *sqlx.DB, e E) api.Storage[E]
- func NewPostgresDB(logger *slog.Logger, host, port, user, password, dbname, sslmode string, ...) (*sqlx.DB, error)
- func RunQuery[E any](ctx context.Context, log *slog.Logger, db *sqlx.DB, ...) error
- type Op
Constants ¶
View Source
const ( // UniqueViolationError is raised if the unique constraint is violated UniqueViolationError = pqerror.Code("23505") // 'unique_violation' )
Variables ¶
This section is empty.
Functions ¶
func IsErrorCode ¶
IsErrorCode a specific postgres specific error as defined by https://www.postgresql.org/docs/18/errcodes-appendix.html
Types ¶
Click to show internal directories.
Click to hide internal directories.