2020-07-08 18:59:37 -07:00
|
|
|
package database
|
|
|
|
|
2020-06-10 16:04:25 -07:00
|
|
|
/*
|
|
|
|
|
2020-07-08 18:59:37 -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-07-08 18:59:37 -07:00
|
|
|
|
2020-06-10 16:04:25 -07:00
|
|
|
go dba.Run(ctx)
|
|
|
|
|
2020-07-08 18:59:37 -07:00
|
|
|
*/
|
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)
|
|
|
|
*/
|