oracle

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(cfg *config.DatabaseConfig, log logger.Logger) (database.Interface, error)

NewConnection creates a new Oracle connection

Types

type Connection

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

Connection implements the database.Interface for Oracle

func (*Connection) Begin

func (c *Connection) Begin(ctx context.Context) (database.Tx, error)

Begin starts a transaction

func (*Connection) BeginTx

func (c *Connection) BeginTx(ctx context.Context, opts *sql.TxOptions) (database.Tx, error)

BeginTx starts a transaction with options

func (*Connection) Close

func (c *Connection) Close() error

Close closes the database connection

func (*Connection) CreateMigrationTable

func (c *Connection) CreateMigrationTable(ctx context.Context) error

CreateMigrationTable creates the migration table if it doesn't exist

func (*Connection) DatabaseType

func (c *Connection) DatabaseType() string

DatabaseType returns the database type

func (*Connection) Exec

func (c *Connection) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

Exec executes a query without returning any rows

func (*Connection) GetMigrationTable

func (c *Connection) GetMigrationTable() string

GetMigrationTable returns the migration table name for Oracle

func (*Connection) Health

func (c *Connection) Health(ctx context.Context) error

Health checks database connectivity

func (*Connection) Prepare

func (c *Connection) Prepare(ctx context.Context, query string) (database.Statement, error)

Prepare creates a prepared statement for later queries or executions

func (*Connection) Query

func (c *Connection) Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

Query executes a query that returns rows

func (*Connection) QueryRow

func (c *Connection) QueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row

QueryRow executes a query that returns at most one row

func (*Connection) Stats

func (c *Connection) Stats() (map[string]interface{}, error)

Stats returns database connection statistics

type Statement added in v0.2.0

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

Statement wraps sql.Stmt to implement database.Statement

func (*Statement) Close added in v0.2.0

func (s *Statement) Close() error

Close closes the prepared statement

func (*Statement) Exec added in v0.2.0

func (s *Statement) Exec(ctx context.Context, args ...interface{}) (sql.Result, error)

Exec executes a prepared statement with arguments

func (*Statement) Query added in v0.2.0

func (s *Statement) Query(ctx context.Context, args ...interface{}) (*sql.Rows, error)

Query executes a prepared query with arguments

func (*Statement) QueryRow added in v0.2.0

func (s *Statement) QueryRow(ctx context.Context, args ...interface{}) *sql.Row

QueryRow executes a prepared query that returns a single row

type Transaction added in v0.2.0

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

Transaction wraps sql.Tx to implement database.Tx

func (*Transaction) Commit added in v0.2.0

func (t *Transaction) Commit() error

Commit commits the transaction

func (*Transaction) Exec added in v0.2.0

func (t *Transaction) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

Exec executes a query without returning rows within the transaction

func (*Transaction) Prepare added in v0.2.0

func (t *Transaction) Prepare(ctx context.Context, query string) (database.Statement, error)

Prepare creates a prepared statement within the transaction

func (*Transaction) Query added in v0.2.0

func (t *Transaction) Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

Query executes a query within the transaction

func (*Transaction) QueryRow added in v0.2.0

func (t *Transaction) QueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row

QueryRow executes a query that returns a single row within the transaction

func (*Transaction) Rollback added in v0.2.0

func (t *Transaction) Rollback() error

Rollback rolls back the transaction

Jump to

Keyboard shortcuts

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