Skip to content

Commit 6a356c3

Browse files
committed
support for oracle in command line pargarm
Signed-off-by: luoji <gunsluo@gmail.com>
1 parent ba2b119 commit 6a356c3

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,25 @@ 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).
135+
136+
**Installation specified sql-migrate**
137+
138+
To install the library and command line program, use the following:
139+
140+
```bash
141+
go get -tags oracle -v github.com/rubenv/sql-migrate/...
142+
```
143+
144+
```yml
145+
development:
146+
dialect: oci8
147+
datasource: user/password@localhost:1521/sid
148+
dir: migrations/oracle
149+
table: migrations
150+
```
151+
133152
### As a library
134153

135154
Import sql-migrate into your application:

sql-migrate/oracle.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// +build oracle
2+
3+
package main
4+
5+
import (
6+
_ "github.com/mattn/go-oci8"
7+
migrate "github.com/rubenv/sql-migrate"
8+
)
9+
10+
func init() {
11+
dialects["oci8"] = migrate.OracleDialect{}
12+
}

0 commit comments

Comments
 (0)