db

package
v0.0.1-20240408-0001 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CRDBDefaultInstanceClient *gorm.DB
View Source
var DefaultInstanceClient *gorm.DB
View Source
var MySQLDefaultInstanceClient *gorm.DB

Functions

func CRDBGetClient

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

func CRDBGetDefaultClient

func CRDBGetDefaultClient() (*gorm.DB, error)

CRDBGetDefaultClient -> this is a common function which helps getting the default Database client based on the current configuration!

func CRDBNew

func CRDBNew(
	ctx context.Context,
	config cockroachConfig.Config,
) (*gorm.DB, error)

CRDBNew -> Creates totally a new DB Client, this is the root function!

func CRDBNewClient

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

CRDBNewClient -> Get the default driver and generate a new client...

func DB

func DB() *gorm.DB

DB -> will get the default client without any errors

func DBCtx

func DBCtx(ctx context.Context) *gorm.DB

func GetClient

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

func GetDefaultClient

func GetDefaultClient() (*gorm.DB, error)

GetDefaultClient -> this is a common function which helps getting the default Database client based on the current configuration!

func GetDefaultClientDriverName

func GetDefaultClientDriverName() string

func MySQLGetClient

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

func MySQLGetDefaultClient

func MySQLGetDefaultClient() (*gorm.DB, error)

MySQLGetDefaultClient -> this is a common function which helps getting the default Database client based on the current configuration!

func MySQLNew

func MySQLNew(
	ctx context.Context,
	config mysqlConfig.Config,
) (*gorm.DB, error)

MySQLNew -> Creates totally a new DB Client, this is the root function!

func MySQLNewClient

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

MySQLNewClient -> Get the default driver and generate a new client...

func New

func New(
	ctx context.Context,
	config dbDriver.Config,
) (*gorm.DB, error)

New -> Creates totally a new DB Client, this is the root function!

func NewClient

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

NewClient -> Get the default driver and generate a new client...

Types

This section is empty.

Jump to

Keyboard shortcuts

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