Skip to content

use godror instead of oci8 & remove -tags oracle#169

Closed
gunsluo wants to merge 0 commit intorubenv:masterfrom
gunsluo:master
Closed

use godror instead of oci8 & remove -tags oracle#169
gunsluo wants to merge 0 commit intorubenv:masterfrom
gunsluo:master

Conversation

@gunsluo
Copy link
Copy Markdown
Contributor

@gunsluo gunsluo commented Mar 31, 2020

Hi, @rubenv

I use godror(oracle driver) instead of oci8.

Advantages:

  1. Don't configure pkg-config
  2. Compiling sql-migrate does not depend on oracle office client. The user can uses the same version to generate postgres & oracle
  3. input LD_LIBRARY_PATH= to configure oracle office client at runtime.

please view.

@rubenv
Copy link
Copy Markdown
Owner

rubenv commented Mar 31, 2020

Hmmm, this is a problem, as it's a C dependency.

It effectively forces everyone to use cgo:

$ CGO_ENABLED=0 go build .
# github.com/godror/godror
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:452:53: undefined: VersionInfo
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:461:53: undefined: VersionInfo
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:479:19: undefined: VersionInfo
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:480:19: undefined: VersionInfo
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:481:30: undefined: ObjectType
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:482:31: undefined: Event
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:482:42: undefined: SubscriptionOption
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:482:64: undefined: Subscription
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:483:10: undefined: StartupMode
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:484:11: undefined: ShutdownMode
../../../../pkg/mod/github.com/godror/godror@v0.13.3/orahlp.go:484:11: too many errors

That wasn't a requirement previously (and I know of projects relying on this), so it's not something we can require now.

@gunsluo
Copy link
Copy Markdown
Contributor Author

gunsluo commented Apr 1, 2020

Hi, @rubenv I run the following command and get this error. I check go-sqlite3 should be enable CGO_ENABLED

CGO_ENABLED=0 GO111MODULE=on go build .
# github.com/mattn/go-sqlite3
../../../../../pkg/mod/github.com/mattn/go-sqlite3@v1.12.0/sqlite3_opt_preupdate.go:12:16: undefined: SQLiteConn
../../../../../pkg/mod/github.com/mattn/go-sqlite3@v1.12.0/sqlite3_opt_preupdate_omit.go:19:10: undefined: SQLiteConn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants