Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBackendNotFound = errors.New("backend not found")
)
Functions ¶
func NewBackendRegistry ¶
func NewBackendRegistry[T BaseQuerier[T]]() *backendRegistry[T]
Types ¶
type BaseBackend ¶
type BaseBackend[T any] struct { CreateTableQuery string NewQuerier func(*sql.DB) (T, error) PreparedQuerier func(ctx context.Context, d *sql.DB) (T, error) }
func (*BaseBackend[T]) CreateTable ¶
func (b *BaseBackend[T]) CreateTable(db *sql.DB) error
func (*BaseBackend[T]) NewQuerySet ¶
func (b *BaseBackend[T]) NewQuerySet(db *sql.DB) (T, error)
type BaseSQLField ¶
type BaseSQLField[DBType, GoType any] struct { ConvertToDB func(*GoType) (DBType, error) ConvertToGO func(DBType) (*GoType, error) // contains filtered or unexported fields }
func EmailField ¶
func EmailField() *BaseSQLField[string, mail.Address]
func NewBaseSQLField ¶
func NewBaseSQLField[DBType, GoType any](convertToDB func(*GoType) (DBType, error), convertToGO func(DBType) (*GoType, error)) *BaseSQLField[DBType, GoType]
func (*BaseSQLField[DBType, GoType]) Scan ¶
func (f *BaseSQLField[DBType, GoType]) Scan(value interface{}) error
Click to show internal directories.
Click to hide internal directories.