oracle

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier[T any](conn *OracleExecutor) querier.Querier[T]

Types

type OracleConf

type OracleConf struct {
	// User is the Oracle database username. Leave empty when using wallet-stored credentials.
	User string
	// Password is the Oracle database password. Leave empty when using wallet-stored credentials.
	Password string
	// Host is the hostname or IP address of the Oracle instance.
	// For OCI: e.g. "adb.eu-frankfurt-1.oraclecloud.com"
	Host string
	// Port is the Oracle listener port. Default: 1521. OCI Autonomous DB with mTLS typically uses 1522.
	Port int
	// ServiceName is the Oracle service name (PDB name).
	// For OCI Autonomous DB: e.g. "mydb_high", "mydb_low", "mydb_tp"
	ServiceName string

	// SSL enables TLS/SSL encryption (TCPS protocol).
	// Required for OCI Autonomous Database. When WalletPath is set, SSL is enabled automatically.
	SSL bool
	// SSLVerify enables server certificate verification when SSL is true.
	// Set to false for self-signed certificates or when using a wallet that handles trust.
	SSLVerify bool

	// WalletPath is the path to an Oracle Wallet directory for mTLS authentication.
	// Download from OCI console → Database connection → Download wallet.
	// The wallet contains TLS certificates (cwallet.sso) and optionally stored credentials.
	// When set, SSL is enabled automatically.
	WalletPath string
}

OracleConf configures a connection to an Oracle Database.

Authentication methods (in order of priority):

  1. Oracle Wallet (mTLS): set WalletPath to a wallet directory. Used by OCI Autonomous Database. The wallet provides TLS certificates and can store credentials.
  2. Username/Password: set User and Password for standard Oracle database authentication.

For OCI Autonomous Database, SSL is required and WalletPath should point to the downloaded wallet directory from the OCI console.

type OracleExecutor

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

func NewOracleExecutor

func NewOracleExecutor(ctx context.Context, conf *OracleConf) (*OracleExecutor, error)

func (*OracleExecutor) Close

func (e *OracleExecutor) Close() error

func (*OracleExecutor) Exec

func (e *OracleExecutor) Exec(ctx context.Context, query string, args ...any) error

func (*OracleExecutor) GetDb

func (e *OracleExecutor) GetDb() *sqlx.DB

func (*OracleExecutor) QueryRows

func (e *OracleExecutor) QueryRows(ctx context.Context, sql string, args ...interface{}) (*sqlx.Rows, error)

func (*OracleExecutor) Select added in v0.11.0

func (e *OracleExecutor) Select(ctx context.Context, dest any, query string, args ...any) error

Jump to

Keyboard shortcuts

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