x/database/doc.go

28 lines
354 B
Go
Raw Normal View History

package database
2020-06-10 16:04:25 -07:00
/*
Example usage:
2020-06-10 16:04:25 -07:00
ctx, _ := context.WithCancel(context.Background())
dba = &db.Actor{
DB: s.db,
2023-04-04 23:19:05 -07:00
ActionChan: make(chan database.Func),
2020-06-10 16:04:25 -07:00
}
2020-06-10 16:04:25 -07:00
go dba.Run(ctx)
*/
2025-03-18 22:28:20 -07:00
/*
Transactor Example:
func insert(ctx context.Context, db *sql.DB) error{
// SQL HERE
}
...
dba.ActionChan <- db.WithTransaction(insert)
*/