sql-migrate
sql-migrate copied to clipboard
How to set db config dialect for oracle ?
I want to try the migration with oracle , looking into 'migrate.go'. I find this code section: var MigrationDialects = map[string]gorp.Dialect{ "sqlite3": gorp.SqliteDialect{}, "postgres": gorp.PostgresDialect{}, "mysql": gorp.MySQLDialect{Engine: "InnoDB", Encoding: "UTF8"}, "mssql": gorp.SqlServerDialect{}, "oci8": gorp.OracleDialect{}, } i assume that dbconfig should use 'oci8' , but it's not working.
Yes, that should be correct. But I have no experience with Oracle, so I can't really help you there.
What I can tell is that for e.g. PostgreSQL you need to explicitly import the database driver:
import (
"database/sql"
_ "github.com/lib/pq"
)
Perhaps something similar is needed for the Oracle driver?
Thank you for your answer. If that is the case then i think i will need to add the driver.
import ( - "github.com/mattn/go-oci8" )
I initially thought that the driver is inherit from 'gorp'. But i will try import the driver explicitly.