Skip to content

Commit 797e86f

Browse files
authored
Merge pull request #170 from gunsluo/master
Add godror support
2 parents baf4e4b + a7acd32 commit 797e86f

5 files changed

Lines changed: 362 additions & 4 deletions

File tree

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ production:
130130

131131
See [here](https://github.com/go-sql-driver/mysql#parsetime) for more information.
132132

133-
### Oracle
134-
Oracle Driver is [oci8](https://github.com/mattn/go-oci8), it is not pure golang code and rely on Oracle Office Client([Instant Client](https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html)), more detail information is [oci8 repo](https://github.com/mattn/go-oci8).
133+
### Oracle (oci8)
134+
Oracle Driver is [oci8](https://github.com/mattn/go-oci8), it is not pure Go code and relies on Oracle Office Client ([Instant Client](https://www.oracle.com/database/technologies/instant-client/downloads.html)), more detailed information is in the [oci8 repo](https://github.com/mattn/go-oci8).
135135

136136
#### Install with Oracle support
137137

@@ -149,6 +149,37 @@ development:
149149
table: migrations
150150
```
151151

152+
### Oracle (godror)
153+
Oracle Driver is [godror](https://github.com/godror/godror), it is not pure Go code and relies on Oracle Office Client ([Instant Client](https://www.oracle.com/database/technologies/instant-client/downloads.html)), more detailed information is in the [godror repository](https://github.com/godror/godror).
154+
155+
#### Install with Oracle support
156+
157+
To install the library and command line program, use the following:
158+
159+
1. Install sql-migrate
160+
```bash
161+
go get -tags godror -v github.com/rubenv/sql-migrate/...
162+
```
163+
164+
2. Download Oracle Office Client(e.g. macos, click [Instant Client](https://www.oracle.com/database/technologies/instant-client/downloads.html) if you are other system)
165+
```bash
166+
wget https://download.oracle.com/otn_software/mac/instantclient/193000/instantclient-basic-macos.x64-19.3.0.0.0dbru.zip
167+
```
168+
169+
3. Configure environment variables `LD_LIBRARY_PATH`
170+
```
171+
export LD_LIBRARY_PATH=your_oracle_office_path/instantclient_19_3
172+
```
173+
174+
```yml
175+
development:
176+
dialect: godror
177+
datasource: user/password@localhost:1521/sid
178+
dir: migrations/oracle
179+
table: migrations
180+
```
181+
182+
152183
### As a library
153184

154185
Import sql-migrate into your application:

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0
77
github.com/go-sql-driver/mysql v1.4.1
88
github.com/gobuffalo/packr/v2 v2.7.1
9+
github.com/godror/godror v0.13.3
910
github.com/lib/pq v1.2.0
1011
github.com/mattn/go-oci8 v0.0.7
1112
github.com/mattn/go-sqlite3 v1.12.0

0 commit comments

Comments
 (0)