Documentation
¶
Index ¶
- func NewQuerier[T any](conn *OracleExecutor) querier.Querier[T]
- type OracleConf
- type OracleExecutor
- func (e *OracleExecutor) Close() error
- func (e *OracleExecutor) Exec(ctx context.Context, query string, args ...any) error
- func (e *OracleExecutor) GetDb() *sqlx.DB
- func (e *OracleExecutor) QueryRows(ctx context.Context, sql string, args ...interface{}) (*sqlx.Rows, error)
- func (e *OracleExecutor) Select(ctx context.Context, dest any, query string, args ...any) error
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):
- Oracle Wallet (mTLS): set WalletPath to a wallet directory. Used by OCI Autonomous Database. The wallet provides TLS certificates and can store credentials.
- 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) GetDb ¶
func (e *OracleExecutor) GetDb() *sqlx.DB
Click to show internal directories.
Click to hide internal directories.