oradb

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 10 Imported by: 0

README

Nebula Oracle Lib

Description

Oracle 操作类库

尽管编译不需要 Oracle 客户端库,但在运行时需要它们。

Oracle 下载免费的 Basic 或 Basic Light 软件包。

安装说明

注意

引用此库后,项目无法进行交叉编译,请使用容器进行编译

Install

go get github.com/ponycool/nebula-oracle-lib

Usage

go get github.com/ponycool/nebula-lib

Test

go test -v ./test/...

Support

Blog: https://mayanpeng.cn

Email: pony#ponycool.com(将#替换为@)

Git: https://github.com/ponycool

DockerHub:https://hub.docker.com/u/ponycool

Authors and acknowledgment

  • zap
  • godror

License

Released under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatOracleConnUri

func FormatOracleConnUri(conf *Config) string

FormatOracleConnUri 格式化连接字符串

func OracleInit

func OracleInit(conf *Config, logger *zap.Logger)

OracleInit 初始化Oracle

func Scan

func Scan(rows *sql.Rows, dest interface{}) error

Scan 扫描

func ScanResult

func ScanResult(rows *sql.Rows, dest interface{}) error

func ScanSlice

func ScanSlice(rows *sql.Rows, dest interface{}) error

Types

type Config

type Config struct {
	User     string `json:"user"`
	Password string `json:"password"`
	Host     string `json:"host"`
	Port     string `json:"port"`
	SID      string `json:"sid"`
}

type IOra

type IOra interface {
	Query(psql string, param ...any) (rows *sql.Rows, err error)
}

type Ora

type Ora struct {
}

func (*Ora) Exec

func (ora *Ora) Exec(psql string, param ...any) (result sql.Result, err error)

Exec 执行

func (*Ora) Query

func (ora *Ora) Query(psql string, param ...any) (rows *sql.Rows, err error)

Query 执行查询

func (*Ora) QueryRow

func (ora *Ora) QueryRow(psql string, param ...any) (row *sql.Row, err error)

QueryRow 执行查询返回一行数据

Jump to

Keyboard shortcuts

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