Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • tools/midicat/v0.8.2
  • v2.2.19
  • drivers/rtmididrv/imported/rtmidi/v0.9.5
  • drivers/rtmididrv/v0.9.5
  • tools/midicat/v0.8.0
  • tools/midicat/v0.8.1
  • v2.2.18
  • drivers/rtmididrv/imported/rtmidi/v0.9.4
  • drivers/rtmididrv/v0.9.4
  • v2.2.17
  • drivers/rtmididrv/imported/rtmidi/v0.9.3
  • drivers/rtmididrv/v0.9.3
  • v2.2.16
  • drivers/rtmididrv/imported/rtmidi/v0.9.2
  • drivers/rtmididrv/v0.9.2
  • v2.2.15
  • v2.2.14
  • tools/hyperarp/v0.0.23
  • tools/midicat/v0.7.1
  • tools/midispy/v2.1.1
21 results

doc.go

basic.go NaN GiB
package postgres

import (
	"github.com/go-pg/pg/v9"
	"gitlab.com/xdevs23/goqlorm/database"
)

type TxMutationAdapter struct {
	tx *pg.Tx
}

func (TxMA TxMutationAdapter) Insert(obj interface{}) error {
	return TxMA.tx.Insert(obj)
}

func (TxMA TxMutationAdapter) Update(obj interface{}) error {
	return TxMA.tx.Update(obj)
}

func (TxMA TxMutationAdapter) Delete(obj interface{}) error {
	return TxMA.tx.Delete(obj)
}

func (db Database) Close() error {
	return db.PgDB.Close()
}

func (db Database) RunInTransaction(fn database.InnerTransactionFunc) error {
	return db.PgDB.RunInTransaction(func(tx *pg.Tx) error {
		return fn(TxMutationAdapter{tx})
	})
}