Documentation ¶
Index ¶
- func CloseAll()
- func CopyDirect(conn database.Connection, tableFName string, srcFile Connection) (cnt uint64, ok bool, 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 ConnEntries
- func (ce ConnEntries) Discover(name string, opt *DiscoverOptions) (nodes filesys.FileNodes, schemata database.Schemata, err error)
- func (ce ConnEntries) Get(name string) ConnEntry
- func (ce ConnEntries) List() (fields []string, rows [][]any)
- 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 (c *Connection) AsDatabase(cache ...bool) (dc database.Connection, err error)
- func (c *Connection) AsDatabaseContext(ctx context.Context, cache ...bool) (dc database.Connection, err error)
- func (c *Connection) AsFile(cache ...bool) (fc filesys.FileSysClient, err error)
- func (c *Connection) AsFileContext(ctx context.Context, cache ...bool) (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) Discover(opt *DiscoverOptions) (ok bool, nodes filesys.FileNodes, schemata database.Schemata, err error)
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDirect ¶
func CopyDirect(conn database.Connection, tableFName string, srcFile Connection) (cnt uint64, ok bool, err error)
CopyDirect copies directly from cloud files (without passing through dbio)
func ReadConnections ¶
func ReadConnections(env map[string]interface{}) (conns map[string]Connection, err error)
func ReadConnectionsEnv ¶
func ReadConnectionsEnv(env map[string]interface{}) (conns map[string]Connection, err error)
ReadConnections loads the connections
func ReadConnectionsFromFile ¶
func ReadConnectionsFromFile(path string) (conns map[string]Connection, err error)
func ReadDbtConnections ¶
func ReadDbtConnections() (conns map[string]Connection, err error)
func SchemeType ¶
SchemeType returns the correct scheme of the url
Types ¶
type ConnEntries ¶ added in v1.2.16
type ConnEntries []ConnEntry
func GetLocalConns ¶
func GetLocalConns(force ...bool) ConnEntries
func (ConnEntries) Discover ¶ added in v1.2.19
func (ce ConnEntries) Discover(name string, opt *DiscoverOptions) (nodes filesys.FileNodes, schemata database.Schemata, err error)
func (ConnEntries) Get ¶ added in v1.2.16
func (ce ConnEntries) Get(name string) ConnEntry
func (ConnEntries) List ¶ added in v1.2.19
func (ce ConnEntries) List() (fields []string, rows [][]any)
type ConnEntry ¶
type ConnEntry struct { Name string `json:"name"` Description string `json:"description"` Source string `json:"source"` Connection Connection `json:"connection"` }
func LocalFileConnEntry ¶
func LocalFileConnEntry() ConnEntry
type Connection ¶
type Connection struct { Name string `json:"name,omitempty"` Type dbio.Type `json:"type,omitempty"` Data map[string]interface{} `json:"data,omitempty"` File filesys.FileSysClient Database database.Connection // contains filtered or unexported fields }
Connection is the base connection struct
func NewConnection ¶
func NewConnection(Name string, t dbio.Type, Data map[string]interface{}) (conn Connection, err error)
NewConnection creates a new connection
func NewConnectionFromDbt ¶
func NewConnectionFromDbt(name string) (c Connection, err error)
NewConnectionFromDbt loads a Connection from a DBT Profile
func NewConnectionFromMap ¶
func NewConnectionFromMap(m map[string]interface{}) (c Connection, err error)
NewConnectionFromMap loads a Connection from a Map
func NewConnectionFromProfiles ¶
func NewConnectionFromProfiles(name string) (c Connection, err error)
NewConnectionFromProfiles loads a Connection from YAML Profiles
func NewConnectionFromURL ¶
func NewConnectionFromURL(Name, URL string) (conn Connection, err error)
NewConnectionFromURL creates a new connection from a url
func (*Connection) AsDatabase ¶
func (c *Connection) AsDatabase(cache ...bool) (dc database.Connection, err error)
func (*Connection) AsDatabaseContext ¶ added in v1.3.4
func (c *Connection) AsDatabaseContext(ctx context.Context, cache ...bool) (dc database.Connection, err error)
func (*Connection) AsFile ¶
func (c *Connection) AsFile(cache ...bool) (fc filesys.FileSysClient, err error)
func (*Connection) AsFileContext ¶ added in v1.3.4
func (c *Connection) AsFileContext(ctx context.Context, cache ...bool) (fc filesys.FileSysClient, err error)
func (*Connection) ConnSetDatabase ¶
func (c *Connection) ConnSetDatabase(dbName string) *Connection
ConnSetDatabase returns a new connection with the specified database name
func (*Connection) Copy ¶
func (c *Connection) Copy() *Connection
ToMap transforms DataConn to a Map
func (*Connection) DataS ¶
func (c *Connection) DataS(lowerCase ...bool) map[string]string
DataS returns data as map[string]string
func (*Connection) Discover ¶ added in v1.2.16
func (c *Connection) Discover(opt *DiscoverOptions) (ok bool, nodes filesys.FileNodes, schemata database.Schemata, err error)
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 in v1.2.16
func (c *Connection) Test() (ok bool, err error)
func (*Connection) ToMap ¶
func (c *Connection) ToMap() map[string]interface{}
ToMap transforms DataConn to a Map
type ConnectionInt ¶
type ConnectionInt interface { // Self() Connection Close() error Context() g.Context Info() Info URL() string DataS(lowerCase ...bool) map[string]string ToMap() map[string]interface{} AsDatabase() (database.Connection, error) AsFile() (filesys.FileSysClient, error) Set(map[string]interface{}) }
ConnectionInt is a connection
type DiscoverOptions ¶
type DiscoverOptions struct { Pattern string `json:"pattern,omitempty"` Level database.SchemataLevel `json:"level,omitempty"` Recursive bool `json:"recursive,omitempty"` }
type EnvFileConns ¶ added in v1.2.19
func (*EnvFileConns) ConnectionEntries ¶ added in v1.2.19
func (ec *EnvFileConns) ConnectionEntries() (entries ConnEntries, err error)
func (*EnvFileConns) GetConnEntry ¶ added in v1.2.19
func (ec *EnvFileConns) GetConnEntry(name string) (conn ConnEntry, ok bool)
GetConnEntry get connection from envfile (may be provided via body)
func (*EnvFileConns) Set ¶ added in v1.2.19
func (ec *EnvFileConns) Set(name string, kvMap map[string]any) (err error)
func (*EnvFileConns) Unset ¶ added in v1.2.19
func (ec *EnvFileConns) Unset(name string) (err error)