db

package
v0.0.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachMigrationFunc

func AttachMigrationFunc(instanceName string, f func(migrator gorm.Migrator) error) error

AttachMigrationFunc - attach migration function to be called by end user

func GetDb

func GetDb(instanceName string) (*gorm.DB, error)

GetDb - Get *gorm.DB instance from the underlying interfaces

func GetMongoDb

func GetMongoDb(instanceName string) (*mongo.Database, error)

GetMongoDb - Get *mongo.Client instance from the underlying interfaces

func Migrate

func Migrate(instanceName string, models ...interface{}) error

Migrate - migrate models on specific database

func NewDeleteModelErr added in v0.0.26

func NewDeleteModelErr(table string, data any, err error) error

NewDeleteModelErr - return a new instance of DeleteModelErr

func NewInsertModelErr added in v0.0.25

func NewInsertModelErr(table string, data any, err error) error

NewInsertModelErr - return a new instance of InsertModelErr

func NewMongoDeleteErr added in v0.0.25

func NewMongoDeleteErr(collection string, filter any, err error) error

NewMongoDeleteErr - return a new instance of MongoDeleteErr

func NewMongoFindQueryErr added in v0.0.25

func NewMongoFindQueryErr(collection string, filter any, err error) error

NewMongoFindQueryErr - return a new instance of MongoFindQueryErr

func NewSelectQueryErr added in v0.0.26

func NewSelectQueryErr(query string, err error) error

NewSelectQueryErr - return a new instance of SelectQueryErr

func NewUpdateModelErr added in v0.0.25

func NewUpdateModelErr(table string, data any, err error) error

NewUpdateModelErr - return a new instance of UpdateModelErr

func SetupManager

func SetupManager()

SetupManager - Setup manager

Types

type DeleteModelErr added in v0.0.26

type DeleteModelErr = db.DeleteModelErr

type InsertModelErr added in v0.0.25

type InsertModelErr = db.InsertModelErr

type MongoDeleteErr added in v0.0.24

type MongoDeleteErr = db.MongoDeleteErr

type MongoFindQueryErr added in v0.0.24

type MongoFindQueryErr = db.MongoFindQueryErr

type SelectQueryErr added in v0.0.26

type SelectQueryErr = db.SelectQueryErr

type UpdateModelErr added in v0.0.25

type UpdateModelErr = db.UpdateModelErr

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL