-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz.go
29 lines (26 loc) · 736 Bytes
/
z.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package internal
import (
"runtime"
"github.com/xo/dburl"
"github.com/xo/usql/drivers"
)
func init() {
if runtime.GOOS == "windows" {
// if no odbc driver, but we have adodb, add 'odbc' (and related
// aliases) as alias for oleodbc
if drivers.Registered("adodb") && !drivers.Registered("odbc") {
old := dburl.Unregister("odbc")
dburl.RegisterAlias("oleodbc", "odbc")
for _, alias := range old.Aliases {
dburl.RegisterAlias("oleodbc", alias)
}
}
}
if drivers.Registered("moderncsqlite") && !drivers.Registered("sqlite3") {
old := dburl.Unregister("sqlite3")
dburl.RegisterAlias("moderncsqlite", "sqlite3")
for _, alias := range old.Aliases {
dburl.RegisterAlias("moderncsqlite", alias)
}
}
}