Documentation
¶
Overview ¶
Package dbmcli 是对外暴露的稳定高层 API(Facade)。
它封装 internal/driver 与 internal/config 的常用组合, 让外部 Go 程序或集成测试能以最小代价使用 dbm 的能力, 而不必直接依赖 internal 包(Go 的 internal 机制禁止跨模块访问)。
用法示例:
cfg := &dbm.Datasource{
Type: "oracle",
Host: "10.0.0.1", Port: 1521,
ServiceName: "ORCLPDB1", User: "ro", Password: os.Getenv("PWD"),
}
conn, err := dbm.Open(ctx, cfg)
...
rows, _ := conn.Metadata().Tables(ctx, "HR")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn 是 internal.driver.Conn 的对外别名。
type Datasource ¶
type Datasource struct {
Type string
Host string
Port int
User string
Password string
Database string // MySQL 等的数据库名
TLS string // 可选 TLS:skip-verify / true / 自定义
ServiceName string // Oracle
SID string // Oracle
AllowWrite bool
ForceVersion string
FetchSize int
MaxOpenConns int
MaxIdleConns int
}
Datasource 是对外暴露的数据源配置(internal 类型的稳定投影)。
Click to show internal directories.
Click to hide internal directories.