sqlite

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// GORM's lifecyle
	HookBeforeCreate = "before_create"
	HookAfterCreate  = "after_create"
	HookBeforeSave   = "before_save"
	HookAfterSave    = "after_save"
	HookBeforeUpdate = "before_update"
	HookAfterUpdate  = "after_update"
	HookBeforeDelete = "before_delete"
	HookAfterDelete  = "after_delete"
	HookAfterFind    = "after_find"
)

Variables

View Source
var (

	// A map of hook to callbacks per GORM’s lifecycle.
	// This allows additional logic to happen when a row is created, updated, deleted, or queried from the database, without changing original model structure or logic.
	// Otherwise we will have to add migration logic from version to version.
	Hooks map[string][]func(*gorm.DB, interface{})
)

Functions

func GetDBByFile

func GetDBByFile(dbFile string) *gorm.DB

func GetGlobalDB

func GetGlobalDB(dbPath string) *gorm.DB

Types

type ContextKey

type ContextKey string

Jump to

Keyboard shortcuts

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