Documentation ¶
Index ¶
- Constants
- func IsNotFound(err error) bool
- type AfterFinder
- type And
- type BeforePutter
- type BeforeUpdater
- type Condition
- type CountParams
- type DeleteParams
- type Eq
- type FindParams
- type Gt
- type Gte
- type In
- type Key
- type Logger
- type Lt
- type Lte
- type Nq
- type Option
- type Or
- type Order
- type Pointable
- type Repository
- type Row
- type Rows
- type SQL
- type Transaction
- type Tx
- type UpdateParams
- type Valueable
Constants ¶
View Source
const ( // NopLogger is a Logger that does nothing. It is used by default, // if no logger is provided on initialization. NopLogger = nopLogger('🚀') // DefaultLogger is a wrapper around slog.Logger. DefaultLogger = slogLogger('🚀') )
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound is a helper functions to check if the error means that no records were found.
Types ¶
type AfterFinder ¶
type BeforePutter ¶
type BeforeUpdater ¶
type BeforeUpdater interface { // BeforeUpdate will be triggered right before "update" query is executed. // If an error is returned, the update will be canceled. On batch action, // the transaction will be aborted and rolled back. BeforeUpdate(context.Context) error }
BeforeUpdater interface.
type Condition ¶
type Condition interface {
// contains filtered or unexported methods
}
Condition interface describes the search condition in Find like methods.
type CountParams ¶
type CountParams struct {
Condition
}
type DeleteParams ¶
type DeleteParams struct {
Condition
}
type Logger ¶
type Logger interface { // BeforeQuery is triggered before the query is executed. BeforeQuery(ctx context.Context, query string, args []any) // AfterQuery is triggered right after the query was executed. AfterQuery(ctx context.Context, query string, args []any, err error, d time.Duration) }
Logger interface for query logging.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option interface is used for initial configuration.
func WithLogger ¶
WithLogger attaches a Logger to Repository on initialization.
func WithStandardSQL ¶
WithStandardSQL attaches sql.DB connection to Repository on initialization.
type Repository ¶
Repository interface is the main set of methods to the repository.
type Transaction ¶
type UpdateParams ¶
Click to show internal directories.
Click to hide internal directories.