connection
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- func CloseAll()
- func CopyDirect(conn database.Connection, tableFName string, srcFile Connection) (cnt uint64, ok bool, err error)
- func LoadAPISpec(specIdentifier string) (spec api.Spec, err error)
- func ReadConnections(env map[string]interface{}) (conns map[string]Connection, err error)
- func ReadConnectionsEnv(env map[string]interface{}) (conns map[string]Connection, err error)
- func ReadConnectionsFromFile(path string) (conns map[string]Connection, err error)
- func ReadDbtConnections() (conns map[string]Connection, err error)
- func SchemeType(url string) dbio.Type
- type AsConnOptions
- type ConnEntries
- func (ce ConnEntries) Discover(name string, opt *DiscoverOptions) (nodes filesys.FileNodes, schemata database.Schemata, endpoints api.Endpoints, ...)
- func (ce ConnEntries) Get(name string) ConnEntry
- func (ce ConnEntries) List() (fields []string, rows [][]any)
- func (ce ConnEntries) Names() (names []string)
- func (ce ConnEntries) Test(name string) (ok bool, err error)
- type ConnEntry
- type Connection
- func NewConnection(Name string, t dbio.Type, Data map[string]interface{}) (conn Connection, err error)
- func NewConnectionFromDbt(name string) (c Connection, err error)
- func NewConnectionFromMap(m map[string]interface{}) (c Connection, err error)
- func NewConnectionFromProfiles(name string) (c Connection, err error)
- func NewConnectionFromURL(Name, URL string) (conn Connection, err error)
- func ParseLocation(location string) (conn Connection, objectExpr string, err error)
- func (c *Connection) AsAPI(options ...AsConnOptions) (ac *api.APIConnection, err error)
- func (c *Connection) AsAPIContext(ctx context.Context, options ...AsConnOptions) (ac *api.APIConnection, err error)
- func (c *Connection) AsDatabase(options ...AsConnOptions) (dc database.Connection, err error)
- func (c *Connection) AsDatabaseContext(ctx context.Context, options ...AsConnOptions) (dc database.Connection, err error)
- func (c *Connection) AsFile(options ...AsConnOptions) (fc filesys.FileSysClient, err error)
- func (c *Connection) AsFileContext(ctx context.Context, options ...AsConnOptions) (fc filesys.FileSysClient, err error)
- func (c *Connection) Close() error
- func (c *Connection) ConnSetDatabase(dbName string) *Connection
- func (c *Connection) Context() *g.Context
- func (c *Connection) Copy() *Connection
- func (c *Connection) DataS(lowerCase ...bool) map[string]string
- func (c *Connection) DataSWithExtra(extra map[string]any) map[string]string
- func (c *Connection) Discover(opt *DiscoverOptions) (ok bool, nodes filesys.FileNodes, schemata database.Schemata, ...)
- func (c *Connection) Hash() string
- func (c *Connection) Info() Info
- func (c *Connection) Set(m map[string]interface{})
- func (c *Connection) Test() (ok bool, err error)
- func (c *Connection) ToMap() map[string]interface{}
- func (c *Connection) URL() string
- type ConnectionInt
- type DiscoverOptions
- type EnvFileConns
- type Info
- type LocalConnsExclude
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcCopyDirect¶
func CopyDirect(conndatabase.Connection, tableFNamestring, srcFileConnection) (cntuint64, okbool, errerror)
CopyDirect copies directly from cloud files(without passing through dbio)
funcLoadAPISpec¶added inv1.4.5
LoadAPISpec loads the spec from the spec location
funcReadConnections¶
func ReadConnections(env map[string]interface{}) (conns map[string]Connection, errerror)
funcReadConnectionsEnv¶
func ReadConnectionsEnv(env map[string]interface{}) (conns map[string]Connection, errerror)
ReadConnections loads the connections
funcReadConnectionsFromFile¶
func ReadConnectionsFromFile(pathstring) (conns map[string]Connection, errerror)
funcReadDbtConnections¶
func ReadDbtConnections() (conns map[string]Connection, errerror)
Types¶
typeAsConnOptions¶added inv1.4.24
typeConnEntries¶added inv1.2.16
type ConnEntries []ConnEntry
funcGetLocalConns¶
func GetLocalConns(options ...any)ConnEntries
func (ConnEntries)Discover¶added inv1.2.19
func (ceConnEntries) Discover(namestring, opt *DiscoverOptions) (nodesfilesys.FileNodes, schematadatabase.Schemata, endpointsapi.Endpoints, errerror)
func (ConnEntries)Get¶added inv1.2.16
func (ceConnEntries) Get(namestring)ConnEntry
func (ConnEntries)List¶added inv1.2.19
func (ceConnEntries) List() (fields []string, rows [][]any)
func (ConnEntries)Names¶added inv1.4.7
func (ceConnEntries) Names() (names []string)
typeConnEntry¶
type ConnEntry struct {Namestring `json:"name"`Descriptionstring `json:"description"`Sourcestring `json:"source"`ConnectionConnection `json:"connection"`}funcLocalFileConnEntry¶
func LocalFileConnEntry()ConnEntry
typeConnection¶
type Connection struct {Namestring `json:"name,omitempty"`Typedbio.Type `json:"type,omitempty"`Data map[string]interface{} `json:"data,omitempty"`Filefilesys.FileSysClientDatabasedatabase.ConnectionAPI *api.APIConnection// contains filtered or unexported fields}Connection is the base connection struct
funcNewConnection¶
NewConnection creates a new connection
funcNewConnectionFromDbt¶
func NewConnectionFromDbt(namestring) (cConnection, errerror)
NewConnectionFromDbt loads a Connection from a DBT Profile
funcNewConnectionFromMap¶
func NewConnectionFromMap(m map[string]interface{}) (cConnection, errerror)
NewConnectionFromMap loads a Connection from a Map
funcNewConnectionFromProfiles¶
func NewConnectionFromProfiles(namestring) (cConnection, errerror)
NewConnectionFromProfiles loads a Connection from YAML Profiles
funcNewConnectionFromURL¶
func NewConnectionFromURL(Name, URLstring) (connConnection, errerror)
NewConnectionFromURL creates a new connection from a url
funcParseLocation¶added inv1.4.5
func ParseLocation(locationstring) (connConnection, objectExprstring, errerror)
func (*Connection)AsAPI¶added inv1.4.5
func (c *Connection) AsAPI(options ...AsConnOptions) (ac *api.APIConnection, errerror)
func (*Connection)AsAPIContext¶added inv1.4.5
func (c *Connection) AsAPIContext(ctxcontext.Context, options ...AsConnOptions) (ac *api.APIConnection, errerror)
func (*Connection)AsDatabase¶
func (c *Connection) AsDatabase(options ...AsConnOptions) (dcdatabase.Connection, errerror)
func (*Connection)AsDatabaseContext¶added inv1.3.4
func (c *Connection) AsDatabaseContext(ctxcontext.Context, options ...AsConnOptions) (dcdatabase.Connection, errerror)
func (*Connection)AsFile¶
func (c *Connection) AsFile(options ...AsConnOptions) (fcfilesys.FileSysClient, errerror)
func (*Connection)AsFileContext¶added inv1.3.4
func (c *Connection) AsFileContext(ctxcontext.Context, options ...AsConnOptions) (fcfilesys.FileSysClient, errerror)
func (*Connection)ConnSetDatabase¶
func (c *Connection) ConnSetDatabase(dbNamestring) *Connection
ConnSetDatabase returns a new connection with the specifieddatabase name
func (*Connection)DataS¶
func (c *Connection) DataS(lowerCase ...bool) map[string]string
DataS returns data as map[string]string
func (*Connection)DataSWithExtra¶added inv1.4.24
func (c *Connection) DataSWithExtra(extra map[string]any) map[string]string
func (*Connection)Discover¶added inv1.2.16
func (c *Connection) Discover(opt *DiscoverOptions) (okbool, nodesfilesys.FileNodes, schematadatabase.Schemata, endpointsapi.Endpoints, errerror)
func (*Connection)Hash¶
func (c *Connection) Hash()string
func (*Connection)Set¶
func (c *Connection) Set(m map[string]interface{})
Set sets key/values from a map
func (*Connection)Test¶added inv1.2.16
func (c *Connection) Test() (okbool, errerror)
func (*Connection)ToMap¶
func (c *Connection) ToMap() map[string]interface{}
ToMap transforms DataConn to a Map
typeConnectionInt¶
type ConnectionInt interface {// Self() ConnectionClose()errorContext()g.ContextInfo()InfoURL()stringDataS(lowerCase ...bool) map[string]stringToMap() map[string]interface{}AsDatabase() (database.Connection,error)AsFile() (filesys.FileSysClient,error)Set(map[string]interface{})}ConnectionInt is a connection
typeDiscoverOptions¶
type DiscoverOptions struct {Patternstring `json:"pattern,omitempty"`Leveldatabase.SchemataLevel `json:"level,omitempty"`Recursivebool `json:"recursive,omitempty"`}typeEnvFileConns¶added inv1.2.19
func (*EnvFileConns)ConnectionEntries¶added inv1.2.19
func (ec *EnvFileConns) ConnectionEntries() (entriesConnEntries, errerror)
func (*EnvFileConns)GetConnEntry¶added inv1.2.19
func (ec *EnvFileConns) GetConnEntry(namestring) (connConnEntry, okbool)
GetConnEntry get connection from envfile (may be provided via body)
func (*EnvFileConns)Set¶added inv1.2.19
func (ec *EnvFileConns) Set(namestring, kvMap map[string]any) (errerror)
func (*EnvFileConns)Unset¶added inv1.2.19
func (ec *EnvFileConns) Unset(namestring) (errerror)
typeLocalConnsExclude¶added inv1.4.11
type LocalConnsExcludestring