点击上方蓝色“ Go语言中文网 ”关注, 每天一起学 Go
前言:写这篇文章的目的有两个,一是希望找到志同道合的伙伴一起维护这个库,提高这个库的代码质量。二是为了推广 gorm 的 oracle 驱动,避免因为操作 oracle 而编写大量的样板代码。同时也要感谢Go 语言中文网的站长 polaris 能用它的公众号为这个库进行推广。
gorm-oracle 开源库地址:https://github.com/cengsin/oracle
欢迎大家积极参与维护 :)
使用 gorm 连接 oracle
前置条件
首先安装 oracle 数据库客户端和 go-oci8
- oracle client: httpwww.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
- go-oci8: https://github.com/mattn/go-oci8
之后配置好环境变量 LD_LIBRARY_PATH
- LD_LIBRAAY_PATH = ${oracle client path}