forked from forgejo/forgejo
Integrate public as bindata optionally (#293)
* Dropped unused codekit config * Integrated dynamic and static bindata for public * Ignore public bindata * Add a general generate make task * Integrated flexible public assets into web command * Updated vendoring, added all missiong govendor deps * Made the linter happy with the bindata and dynamic code * Moved public bindata definition to modules directory * Ignoring the new bindata path now * Updated to the new public modules import path * Updated public bindata command and drop the new prefix
This commit is contained in:
parent
4680c349dd
commit
b6a95a8cb3
691 changed files with 305318 additions and 1272 deletions
48
vendor/github.com/go-xorm/tidb/tidb_driver.go
generated
vendored
Normal file
48
vendor/github.com/go-xorm/tidb/tidb_driver.go
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
// 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 tidb
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/go-xorm/core"
|
||||
)
|
||||
|
||||
var (
|
||||
_ core.Dialect = (*tidb)(nil)
|
||||
|
||||
DBType core.DbType = "tidb"
|
||||
)
|
||||
|
||||
func init() {
|
||||
core.RegisterDriver(string(DBType), &tidbDriver{})
|
||||
core.RegisterDialect(DBType, func() core.Dialect {
|
||||
return &tidb{}
|
||||
})
|
||||
}
|
||||
|
||||
type tidbDriver struct {
|
||||
}
|
||||
|
||||
func (p *tidbDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) {
|
||||
u, err := url.Parse(dataSourceName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if u.Scheme != "goleveldb" && u.Scheme != "memory" && u.Scheme != "boltdb" {
|
||||
return nil, errors.New(u.Scheme + " is not supported yet.")
|
||||
}
|
||||
path := filepath.Join(u.Host, u.Path)
|
||||
dbName := filepath.Clean(filepath.Base(path))
|
||||
|
||||
uri := &core.Uri{
|
||||
DbType: DBType,
|
||||
DbName: dbName,
|
||||
}
|
||||
|
||||
return uri, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue