godror

package
v1.1.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginsRoot = root + ".plugins"
)

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func NewDB

func NewDB(ctx context.Context, plugins ...Plugin) (*sql.DB, error)

NewDB returns a new DB.

func NewDBWithConfigPath

func NewDBWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*sql.DB, error)

NewDBWithConfigPath returns a new sql DB with options from config path.

func NewDBWithOptions

func NewDBWithOptions(ctx context.Context, o *Options, plugins ...Plugin) (db *sql.DB, err error)

NewDBWithOptions returns a new sql DB with options.

Types

type ManagedDB

type ManagedDB struct {
	DB      *sql.DB
	Plugins []Plugin
	Options *Options
}

ManagedDB represents a managed db client for oracle.

func NewManagedDB

func NewManagedDB(ctx context.Context, plugins ...Plugin) (*ManagedDB, error)

NewManagedDB returns a managed db client with default options.

func NewManagedDBWithConfigPath

func NewManagedDBWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*ManagedDB, error)

NewManagedDBWithConfigPath returns a managed db client with options from config path.

func NewManagedDBWithOptions

func NewManagedDBWithOptions(ctx context.Context, opts *Options, plugins ...Plugin) (*ManagedDB, error)

NewManagedDBWithOptions returns a managed db client with options.

type Options

type Options struct {
	ConnectString       string
	Username            string
	Password            string
	MaxLifetime         time.Duration
	SessionTimeout      time.Duration
	WaitTimeout         time.Duration
	MaxSessions         int
	SessionIncrement    int
	MinSessions         int
	MaxSessionsPerShard int
}

Options represents a godror options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals options based a given key path.

type Plugin

type Plugin func(context.Context, *sql.DB) error

Plugin defines a go driver for oracle plugin signature.

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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