dbms

package
v0.0.0-...-82b17fd Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxBufferSize = 0x7FFF
	MinBufferSize = 2000
	KeyInContext  = "GO-ORA.DBMS_OUTPUT"
)

Variables

This section is empty.

Functions

func DisableOutput

func DisableOutput(ctx context.Context) error

disable oracle output for current session

func EnableOutput

func EnableOutput(ctx context.Context, conn *sql.DB) error

enable oracle output for current session param:

ctx: context of goroutine used in large apps
     for main: context.Background()
     for rest apis:
       http.Request.Context()
       gin.Context
       fiber.Ctx.Context()
       ...

func GetOutput

func GetOutput(ctx context.Context) (string, error)

get oracle output for current session

func PrintOutput

func PrintOutput(ctx context.Context, w io.StringWriter) error

print oracle output into StringWriter for current session

Types

type AQ

type AQ struct {
	Name          string `db:"QUEUE_NAME"`
	TableName     string `db:"TB_NAME"`
	TypeName      string `db:"TYPE_NAME"`
	Owner         string
	MaxRetry      int64  `db:"MAX_RETRY"`
	RetryDelay    int64  `db:"RETRY_DELAY"`
	RetentionTime int64  `db:"RETENTION_TIME"`
	Comment       string `db:"COMMENT"`
	// contains filtered or unexported fields
}

func NewAQ

func NewAQ(conn *sql.DB, name, typeName string) *AQ

func (*AQ) Create

func (aq *AQ) Create() error

func (*AQ) Dequeue

func (aq *AQ) Dequeue(message driver.Value) (messageID []byte, err error)

func (*AQ) Drop

func (aq *AQ) Drop() error

func (*AQ) Enqueue

func (aq *AQ) Enqueue(message driver.Value) (messageID []byte, err error)

func (*AQ) Start

func (aq *AQ) Start(enqueue, dequeue bool) error

enable both enqueue and dequeue

func (*AQ) Stop

func (aq *AQ) Stop(enqueue, dequeue bool) error

disable both enqueue and dequeue

type DBOutput

type DBOutput struct {
	// contains filtered or unexported fields
}

func NewOutput

func NewOutput(conn *sql.DB, bufferSize int) (*DBOutput, error)

func (*DBOutput) Close

func (output *DBOutput) Close() error

func (*DBOutput) GetOutput

func (db_out *DBOutput) GetOutput() (string, error)

func (*DBOutput) Print

func (db_out *DBOutput) Print(w io.StringWriter) error

Jump to

Keyboard shortcuts

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