diff options
Diffstat (limited to 'vendor/github.com/go-xorm/xorm/oci8_driver.go')
-rw-r--r-- | vendor/github.com/go-xorm/xorm/oci8_driver.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/vendor/github.com/go-xorm/xorm/oci8_driver.go b/vendor/github.com/go-xorm/xorm/oci8_driver.go deleted file mode 100644 index ec5f2022..00000000 --- a/vendor/github.com/go-xorm/xorm/oci8_driver.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015 The Xorm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xorm - -import ( - "errors" - "regexp" - - "github.com/go-xorm/core" -) - -type oci8Driver struct { -} - -//dataSourceName=user/password@ipv4:port/dbname -//dataSourceName=user/password@[ipv6]:port/dbname -func (p *oci8Driver) Parse(driverName, dataSourceName string) (*core.Uri, error) { - db := &core.Uri{DbType: core.ORACLE} - dsnPattern := regexp.MustCompile( - `^(?P<user>.*)\/(?P<password>.*)@` + // user:password@ - `(?P<net>.*)` + // ip:port - `\/(?P<dbname>.*)`) // dbname - matches := dsnPattern.FindStringSubmatch(dataSourceName) - names := dsnPattern.SubexpNames() - for i, match := range matches { - switch names[i] { - case "dbname": - db.DbName = match - } - } - if db.DbName == "" { - return nil, errors.New("dbname is empty") - } - return db, nil -} |