Documentation
¶
Index ¶
- Constants
- Variables
- func DateFromRataDie(d int64) time.Time
- func DateFromRataMillis(d int64) time.Time
- func Encode(w io.Writer, item interface{}, indent int) error
- func LoadConfig(cfg *Config) error
- func LoadConfigFile(fname, profile string, cfg *Config) error
- func LoadConfigProfile(profile string, cfg *Config) error
- func LoadConfigString(source, profile string, cfg *Config) error
- func NewBigInt128(lo, hi uint64) *big.Int
- func NewBigUint128(lo, hi uint64) *big.Int
- func NewDecimal128(lo, hi uint64, digits int32) decimal.Decimal
- func NewRational128(n, d *big.Int) *big.Rat
- func Print(item interface{}, indent int) errordeprecated
- func ShowJSON(item interface{}, indent int) error
- func ShowMetadata(m *pb.MetadataInfo)
- func ShowRelation(r Relation)
- func ShowTabularData(d Tabular)
- type AccessToken
- type AccessTokenHandler
- type CSVOptions
- func (opts *CSVOptions) WithDelim(delim rune) *CSVOptions
- func (opts *CSVOptions) WithEscapeChar(escapeChar rune) *CSVOptions
- func (opts *CSVOptions) WithHeaderRow(headerRow int) *CSVOptions
- func (opts *CSVOptions) WithQuoteChar(quoteChar rune) *CSVOptions
- func (opts *CSVOptions) WithSchema(schema map[string]string) *CSVOptions
- type Char
- type Client
- func (c *Client) AccessToken() (string, error)
- func (c *Client) CancelTransaction(id string) (string, error)
- func (c *Client) CloneDatabase(database, source string) (*Database, error)
- func (c *Client) Context() context.Context
- func (c *Client) CreateDatabase(database string) (*Database, error)
- func (c *Client) CreateEngine(engine, size string) (*Engine, error)
- func (c *Client) CreateEngineAsync(engine, size string) (*Engine, error)
- func (c *Client) CreateOAuthClient(name string, perms []string) (*OAuthClientExtra, error)
- func (c *Client) CreateSnowflakeDataStream(integration, dbLink string, opts *DataStreamOpts) (*SnowflakeDataStream, error)
- func (c *Client) CreateSnowflakeDatabaseLink(integration, database, schema, role string, creds *SnowflakeCredentials) (*SnowflakeDatabaseLink, error)
- func (c *Client) CreateSnowflakeIntegration(name, snowflakeAccount string, adminCreds, proxyCreds *SnowflakeCredentials) (*Integration, error)
- func (c *Client) CreateUser(email string, roles []string) (*User, error)
- func (c *Client) Delete(path string, args url.Values, data, result interface{}) error
- func (c *Client) DeleteDatabase(database string) error
- func (c *Client) DeleteEngine(engine string) error
- func (c *Client) DeleteEngineAsync(engine string) (*Engine, error)
- func (c *Client) DeleteModel(database, engine, name string) (*TransactionResult, error)
- func (c *Client) DeleteModels(database, engine string, models []string) (*TransactionResult, error)
- func (c *Client) DeleteOAuthClient(id string) (*DeleteOAuthClientResponse, error)
- func (c *Client) DeleteSnowflakeDataStream(integration, dbLink, objectName, role string, creds *SnowflakeCredentials) error
- func (c *Client) DeleteSnowflakeDatabaseLink(integration, database, schema, role string, creds *SnowflakeCredentials) error
- func (c *Client) DeleteSnowflakeIntegration(name string, adminCreds *SnowflakeCredentials) error
- func (c *Client) DeleteUser(id string) (*DeleteUserResponse, error)
- func (c *Client) DisableUser(id string) (*User, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) EnableUser(id string) (*User, error)
- func (c *Client) Execute(database, engine, source string, inputs map[string]string, readonly bool, ...) (*TransactionResponse, error)
- func (c *Client) ExecuteAsync(database, engine, query string, inputs map[string]string, readonly bool, ...) (*TransactionResponse, error)
- func (c *Client) ExecuteV1(database, engine, source string, inputs map[string]string, readonly bool) (*TransactionResult, error)deprecated
- func (c *Client) FindOAuthClient(name string) (*OAuthClient, error)
- func (c *Client) FindUser(email string) (*User, error)
- func (c *Client) Get(path string, headers map[string]string, args url.Values, result interface{}) error
- func (c *Client) GetAccessToken(creds *ClientCredentials) (*AccessToken, error)
- func (c *Client) GetDatabase(database string) (*Database, error)
- func (c *Client) GetEngine(engine string) (*Engine, error)
- func (c *Client) GetModel(database, engine, model string) (*Model, error)
- func (c *Client) GetOAuthClient(id string) (*OAuthClientExtra, error)
- func (c *Client) GetSnowflakeDataStream(integration, dbLink, objectName string) (*SnowflakeDataStream, error)
- func (c *Client) GetSnowflakeDataStreamStatus(integration, dbLink, objectName string) (*SnowflakeDataStreamStatus, error)
- func (c *Client) GetSnowflakeDatabaseLink(integration, database, schema string) (*SnowflakeDatabaseLink, error)
- func (c *Client) GetSnowflakeIntegration(name string) (*Integration, error)
- func (c *Client) GetTransaction(id string, opts ...GetTransactionOptions) (*TransactionResponse, error)
- func (c *Client) GetTransactionMetadata(id string) (*TransactionMetadata, error)
- func (c *Client) GetTransactionProblems(id string) ([]Problem, error)
- func (c *Client) GetTransactionResults(id string) (map[string]*Partition, error)
- func (c *Client) GetUser(id string) (*User, error)
- func (c *Client) ListDatabases(filters ...interface{}) ([]Database, error)
- func (c *Client) ListEDBs(database, engine string) ([]EDB, error)
- func (c *Client) ListEngines(filters ...interface{}) ([]Engine, error)
- func (c *Client) ListModelNames(database, engine string) ([]string, error)
- func (c *Client) ListModels(database, engine string) ([]Model, error)
- func (c *Client) ListOAuthClients() ([]OAuthClient, error)
- func (c *Client) ListSnowflakeDataStreams(integration, dbLink string) ([]SnowflakeDataStream, error)
- func (c *Client) ListSnowflakeDatabaseLinks(integration string) ([]SnowflakeDatabaseLink, error)
- func (c *Client) ListSnowflakeIntegrations() ([]Integration, error)
- func (c *Client) ListTransactions(tags ...string) ([]Transaction, error)
- func (c *Client) ListUsers() ([]User, error)
- func (c *Client) LoadCSV(database, engine, relation string, r io.Reader, opts *CSVOptions) (*TransactionResult, error)
- func (c *Client) LoadJSON(database, engine, relation string, r io.Reader) (*TransactionResult, error)
- func (c *Client) LoadModel(database, engine, name string, r io.Reader) (*TransactionResult, error)
- func (c *Client) LoadModels(database, engine string, models map[string]io.Reader) (*TransactionResult, error)
- func (c *Client) Patch(path string, args url.Values, data, result interface{}) error
- func (c *Client) Post(path string, args url.Values, data, result interface{}) error
- func (c *Client) Put(path string, args url.Values, data, result interface{}) error
- func (c *Client) SetAccessTokenHandler(handler AccessTokenHandler)
- func (c *Client) SetContext(ctx context.Context)
- func (c *Client) UpdateSnowflakeDatabaseLink(integration, database, schema, role string, creds *SnowflakeCredentials) error
- func (c *Client) UpdateSnowflakeIntegration(name, raiClientID, raiClientSecret string, proxyCreds *SnowflakeCredentials) error
- func (c *Client) UpdateUser(id string, req UpdateUserRequest) (*User, error)
- func (c *Client) Url(path string) string
- type ClientCredentials
- type ClientCredentialsHandler
- type ClientOptions
- type Column
- type Config
- type ConstType
- type DataColumn
- type DataStreamOpts
- type Database
- type DbAction
- type DeleteEngineStatus
- type DeleteOAuthClientResponse
- type DeleteUserResponse
- type EDB
- type Engine
- type GetTransactionOptions
- type HTTPError
- type Int128
- type Integration
- type IntegrityConstraintViolation
- type Missing
- type Mixed
- type Model
- type NopAccessTokenHandler
- type OAuthClient
- type OAuthClientExtra
- type Partition
- func (p *Partition) Column(rnum int) Column
- func (p *Partition) Columns() []Column
- func (p *Partition) GetItem(rnum int, out []any)
- func (p *Partition) GetRow(rnum int, out []any)
- func (p *Partition) Item(rnum int) []any
- func (p *Partition) NumCols() int
- func (p *Partition) NumRows() int
- func (p *Partition) Record() arrow.Record
- func (p *Partition) Row(rnum int) []any
- func (p *Partition) Signature() Signature
- func (p *Partition) String(rnum int) string
- func (p *Partition) Strings(rnum int) []string
- func (p *Partition) Type() any
- func (p *Partition) Value(rnum int) any
- type PreRequestHook
- type PrimitiveTypes
- type Problem
- type ProblemV1
- type RelKey
- type Relation
- type RelationCollection
- type RelationV1
- type Showable
- type Signature
- type SimpleColumn
- type SimpleTypes
- type SnowflakeCredentials
- type SnowflakeDataStream
- type SnowflakeDataStreamStatus
- type SnowflakeDatabaseLink
- type Source
- type Tabular
- type TabularColumn
- type Transaction
- type TransactionMetadata
- type TransactionRequest
- type TransactionResponse
- func (t *TransactionResponse) EnsureMetadata(c *Client) (*TransactionMetadata, error)
- func (t *TransactionResponse) EnsureProblems(c *Client) ([]Problem, error)
- func (t *TransactionResponse) EnsureResults(c *Client) (map[string]*Partition, error)
- func (t *TransactionResponse) Partition(id string) *Partition
- func (t *TransactionResponse) Relation(id string) Relation
- func (t *TransactionResponse) Relations(args ...any) RelationCollection
- func (rsp *TransactionResponse) Show()
- func (t TransactionResponse) Signature(id string) Signature
- type TransactionResult
- type TransactionState
- type TransactionV1
- type Uint128
- type Unknown
- type Unspecified
- type UpdateUserRequest
- type User
- type ValueType
Constants ¶
const ( PathDatabase = "/database" PathEngine = "/compute" PathIntegrations = "/integration/v1alpha1/integrations" PathOAuthClients = "/oauth-clients" PathTransaction = "/transaction" PathTransactions = "/transactions" PathUsers = "/users" )
const DefaultConfigFile = "~/.rai/config"
const DefaultConfigProfile = "default"
const DefaultHost = "azure.relationalai.com"
const DefaultPort = "443"
const DefaultRegion = "us-east"
const DefaultScheme = "https"
const Version = "0.5.4-alpha"
Variables ¶
var ( // Simple types BoolType = typeOf[bool]() CharType = typeOf[Char]() Float16Type = typeOf[float16.Num]() Float64Type = typeOf[float64]() Float32Type = typeOf[float32]() Int128Type = typeOf[Int128]() Int64Type = typeOf[int64]() Int32Type = typeOf[int32]() Int16Type = typeOf[int16]() Int8Type = typeOf[int8]() StringType = typeOf[string]() Uint128Type = typeOf[Uint128]() Uint64Type = typeOf[uint64]() Uint32Type = typeOf[uint32]() Uint16Type = typeOf[uint16]() Uint8Type = typeOf[uint8]() UnspecifiedType = typeOf[Unspecified]() // Composite types AnyListType = typeOf[[]any]() Float32ListType = typeOf[[]float32]() Float64ListType = typeOf[[]float64]() Int8ListType = typeOf[[]int8]() Int16ListType = typeOf[[]int16]() Int32ListType = typeOf[[]int32]() Int64ListType = typeOf[[]int64]() Uint64ListType = typeOf[[]uint64]() StructType = typeOf[array.Struct]() )
Partition column types (many also appear in relations)
var ( AnyType = typeOf[any]() // heterogenous, tabular column BigIntType = typeOf[*big.Int]() TimeType = typeOf[time.Time]() DecimalType = typeOf[decimal.Decimal]() RationalType = typeOf[*big.Rat]() RuneType = typeOf[rune]() MissingType = typeOf[Missing]() MixedType = typeOf[Mixed]() )
Relation specific column types
var ErrMissingFilterValue = errors.New("missing filter value")
var ErrNotFound = newHTTPError(http.StatusNotFound, nil, "")
var UnknownType = typeOf[Unknown]()
Functions ¶
func DateFromRataDie ¶
Returns the epoch millis corresponding to the given Rata Die day number.
func DateFromRataMillis ¶
Returns the epoch millis corresponding to the given millis since 1AD.
func LoadConfig ¶
Load settings from the default profile of the default config file.
func LoadConfigFile ¶
Load settings from the given profile of the named config file.
func LoadConfigProfile ¶
Load settings from the given profile in the default config file.
func LoadConfigString ¶
Load settings from the given profile of the provided config source.
func NewBigInt128 ¶
func NewBigUint128 ¶
func ShowRelation ¶
func ShowRelation(r Relation)
Types ¶
type AccessToken ¶
type AccessToken struct { Token string `json:"access_token"` Scope string `json:"scope"` ExpiresIn int `json:"expires_in"` // token lifetime in seconds CreatedOn int64 `json:"created_on"` // epoch seconds }
todo: make sure CreatedOn is persisted as epoch seconds
func (*AccessToken) ExpiresOn ¶
func (a *AccessToken) ExpiresOn() int64
Instant the token expires in epoch seconds.
func (*AccessToken) IsExpired ¶
func (a *AccessToken) IsExpired() bool
Anticipate access token expiration by 5 seconds
func (*AccessToken) String ¶
func (a *AccessToken) String() string
type AccessTokenHandler ¶
type CSVOptions ¶
type CSVOptions struct { Schema map[string]string HeaderRow *int Delim rune EscapeChar rune QuoteChar rune }
func NewCSVOptions ¶
func NewCSVOptions() *CSVOptions
func (*CSVOptions) WithDelim ¶
func (opts *CSVOptions) WithDelim(delim rune) *CSVOptions
func (*CSVOptions) WithEscapeChar ¶
func (opts *CSVOptions) WithEscapeChar(escapeChar rune) *CSVOptions
func (*CSVOptions) WithHeaderRow ¶
func (opts *CSVOptions) WithHeaderRow(headerRow int) *CSVOptions
func (*CSVOptions) WithQuoteChar ¶
func (opts *CSVOptions) WithQuoteChar(quoteChar rune) *CSVOptions
func (*CSVOptions) WithSchema ¶
func (opts *CSVOptions) WithSchema(schema map[string]string) *CSVOptions
type Client ¶
type Client struct { Region string Scheme string Host string Port string HttpClient *http.Client // contains filtered or unexported fields }
func NewClientFromConfig ¶
Returns a new client using the background context and config settings from the named profile.
func NewDefaultClient ¶
Returns a new client using the background context and config settings from the default profile.
func (*Client) AccessToken ¶
Returns the current access token
func (*Client) CancelTransaction ¶ added in v0.1.1
func (*Client) CloneDatabase ¶
func (*Client) CreateEngine ¶
Request the creation of an engine, and wait for the opeartion to complete. This can block the caller for up to a minute.
func (*Client) CreateEngineAsync ¶
Request the creation of an engine, and immediately return. The process of provisioning a new engine can take up to a minute.
func (*Client) CreateOAuthClient ¶
func (c *Client) CreateOAuthClient( name string, perms []string, ) (*OAuthClientExtra, error)
func (*Client) CreateSnowflakeDataStream ¶
func (c *Client) CreateSnowflakeDataStream( integration, dbLink string, opts *DataStreamOpts, ) (*SnowflakeDataStream, error)
Creates a data stream to replicate data from a Snowflake table/view to a RAI relation.
func (*Client) CreateSnowflakeDatabaseLink ¶
func (c *Client) CreateSnowflakeDatabaseLink( integration, database, schema, role string, creds *SnowflakeCredentials, ) (*SnowflakeDatabaseLink, error)
Creates a new Snowflake database link, populating the target db and schema with Snowflake integration objects.
schema is optional, and will default to 'rai' when left empty
If the schema doesn't exist when CreateSnowflakeDatabaseLink is called, it will be created using the supplied credentials and ownership will be assigned to the specified role
func (*Client) CreateSnowflakeIntegration ¶
func (c *Client) CreateSnowflakeIntegration( name, snowflakeAccount string, adminCreds, proxyCreds *SnowflakeCredentials, ) (*Integration, error)
func (*Client) CreateUser ¶
func (*Client) DeleteDatabase ¶
func (*Client) DeleteEngine ¶
Request the deletion of an engine and wait for the operation to complete.
func (*Client) DeleteEngineAsync ¶
func (*Client) DeleteModel ¶
func (c *Client) DeleteModel( database, engine, name string, ) (*TransactionResult, error)
func (*Client) DeleteModels ¶
func (c *Client) DeleteModels( database, engine string, models []string, ) (*TransactionResult, error)
func (*Client) DeleteOAuthClient ¶
func (c *Client) DeleteOAuthClient(id string) (*DeleteOAuthClientResponse, error)
func (*Client) DeleteSnowflakeDataStream ¶
func (c *Client) DeleteSnowflakeDataStream( integration, dbLink, objectName, role string, creds *SnowflakeCredentials, ) error
Deletes a data stream creds are optional; passing nil will fall back to stored SF credentials
func (*Client) DeleteSnowflakeDatabaseLink ¶
func (c *Client) DeleteSnowflakeDatabaseLink( integration, database, schema, role string, creds *SnowflakeCredentials, ) error
func (*Client) DeleteSnowflakeIntegration ¶
func (c *Client) DeleteSnowflakeIntegration(name string, adminCreds *SnowflakeCredentials) error
func (*Client) DeleteUser ¶
func (c *Client) DeleteUser(id string) (*DeleteUserResponse, error)
func (*Client) Execute ¶
func (c *Client) Execute( database, engine, source string, inputs map[string]string, readonly bool, tags ...string, ) (*TransactionResponse, error)
todo: consider making the polling coefficients part of tx options
func (*Client) ExecuteAsync ¶
func (*Client) FindOAuthClient ¶
func (c *Client) FindOAuthClient(name string) (*OAuthClient, error)
Returns the OAuth client with the given name or ErrNotFound if it does not exist.
func (*Client) GetAccessToken ¶
func (c *Client) GetAccessToken(creds *ClientCredentials) (*AccessToken, error)
Fetch a new access token using the given client credentials.
func (*Client) GetOAuthClient ¶
func (c *Client) GetOAuthClient(id string) (*OAuthClientExtra, error)
func (*Client) GetSnowflakeDataStream ¶
func (c *Client) GetSnowflakeDataStream( integration, dbLink, objectName string, ) (*SnowflakeDataStream, error)
func (*Client) GetSnowflakeDataStreamStatus ¶
func (c *Client) GetSnowflakeDataStreamStatus( integration, dbLink, objectName string, ) (*SnowflakeDataStreamStatus, error)
func (*Client) GetSnowflakeDatabaseLink ¶
func (c *Client) GetSnowflakeDatabaseLink( integration, database, schema string, ) (*SnowflakeDatabaseLink, error)
func (*Client) GetSnowflakeIntegration ¶
func (c *Client) GetSnowflakeIntegration(name string) (*Integration, error)
func (*Client) GetTransaction ¶
func (c *Client) GetTransaction(id string, opts ...GetTransactionOptions) ( *TransactionResponse, error, )
Returns the transaction resource identified by `id` and any other outputs selected in `opts`, if available.
func (*Client) GetTransactionMetadata ¶
func (c *Client) GetTransactionMetadata(id string) ( *TransactionMetadata, error, )
func (*Client) GetTransactionProblems ¶
todo: deprecated, should be loaded from partitions
func (*Client) GetTransactionResults ¶
func (*Client) ListDatabases ¶
func (*Client) ListEngines ¶
func (*Client) ListModelNames ¶
Returns a list of model names for the given database.
func (*Client) ListModels ¶
Returns the names of models installed in the given database.
func (*Client) ListOAuthClients ¶
func (c *Client) ListOAuthClients() ([]OAuthClient, error)
func (*Client) ListSnowflakeDataStreams ¶
func (c *Client) ListSnowflakeDataStreams( integration, dbLink string, ) ([]SnowflakeDataStream, error)
func (*Client) ListSnowflakeDatabaseLinks ¶
func (c *Client) ListSnowflakeDatabaseLinks( integration string, ) ([]SnowflakeDatabaseLink, error)
func (*Client) ListSnowflakeIntegrations ¶
func (c *Client) ListSnowflakeIntegrations() ([]Integration, error)
func (*Client) ListTransactions ¶
func (c *Client) ListTransactions(tags ...string) ([]Transaction, error)
func (*Client) LoadCSV ¶
func (c *Client) LoadCSV( database, engine, relation string, r io.Reader, opts *CSVOptions, ) (*TransactionResult, error)
func (*Client) LoadModels ¶
func (*Client) SetAccessTokenHandler ¶
func (c *Client) SetAccessTokenHandler(handler AccessTokenHandler)
func (*Client) SetContext ¶
func (*Client) UpdateSnowflakeDatabaseLink ¶
func (c *Client) UpdateSnowflakeDatabaseLink( integration, database, schema, role string, creds *SnowflakeCredentials, ) error
func (*Client) UpdateSnowflakeIntegration ¶
func (c *Client) UpdateSnowflakeIntegration( name, raiClientID, raiClientSecret string, proxyCreds *SnowflakeCredentials, ) error
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(id string, req UpdateUserRequest) (*User, error)
type ClientCredentials ¶
type ClientCredentialsHandler ¶
type ClientCredentialsHandler struct {
// contains filtered or unexported fields
}
func NewClientCredentialsHandler ¶
func NewClientCredentialsHandler( c *Client, creds *ClientCredentials, ) *ClientCredentialsHandler
This handler uses the given OAuth client credentials to retrieve access tokens, as needed, and caches them locally in ~/.rai/tokens.json.
func (*ClientCredentialsHandler) GetAccessToken ¶
func (h *ClientCredentialsHandler) GetAccessToken() (string, error)
type ClientOptions ¶
type ClientOptions struct { Config HTTPClient *http.Client AccessTokenHandler AccessTokenHandler PreRequestHook PreRequestHook }
func NewClientOptions ¶
func NewClientOptions(cfg *Config) *ClientOptions
type Column ¶
type Column interface { NumRows() int String(int) string Type() any // reflect.Type | MixedType Value(int) any }
Column provides access to a single column of data.
type Config ¶
type Config struct { Region string `json:"region"` Scheme string `json:"scheme"` Host string `json:"host"` Port string `json:"port"` Credentials *ClientCredentials `json:"credentials"` }
type DataColumn ¶
DataColumn is a Column with a typed accessor.
type DataStreamOpts ¶
type Database ¶
type Database struct { ID string `json:"id"` Name string `json:"name"` Region string `json:"region"` AccountName string `json:"account_name"` CreatedBy string `json:"created_by"` CreatedOn string `json:"created_on"` DeletedBy string `json:"deleted_by,omitempty"` DeletedOn string `json:"deleted_on,omitempty"` State string `json:"state"` }
type DeleteEngineStatus ¶
type DeleteUserResponse ¶
type EDB ¶
type EDB struct { Name string `json:"name"` Keys []interface{} `json:"keys"` Values []interface{} `json:"values"` }
type Engine ¶
type Engine struct { ID string `json:"id"` Name string `json:"name"` Region string `json:"region"` AccountName string `json:"account_name"` CreatedBy string `json:"created_by"` CreatedOn string `json:"created_on,omitempty"` // todo: required? DeletedOn string `json:"deleted_on,omitempty"` Size string `json:"size"` State string `json:"state"` }
type GetTransactionOptions ¶
If any of the following are true, `GetTransaction` will retrieve the corresponding outputs, if available.
type Integration ¶
type Integration struct { ID string `json:"id"` Kind string `json:"kind"` Name string `json:"name"` Account string `json:"account"` CreatedBy string `json:"createdBy"` CreatedOn string `json:"createdOn"` State string `json:"state"` ConsentURL string `json:"consentUrl"` Snowflake struct { Account string `json:"account"` } `json:"snowflake"` }
type NopAccessTokenHandler ¶
type NopAccessTokenHandler struct{}
This handler always returns an empty token, which results in requests not being authenticated.
func NewNopAccessTokenHandler ¶
func NewNopAccessTokenHandler() NopAccessTokenHandler
func (NopAccessTokenHandler) GetAccessToken ¶
func (h NopAccessTokenHandler) GetAccessToken() (string, error)
type OAuthClient ¶
type OAuthClientExtra ¶
type OAuthClientExtra struct { OAuthClient Permissions []string `json:"permissions"` Secret string `json:"secret"` }
type Partition ¶
type Partition struct {
// contains filtered or unexported fields
}
type PrimitiveTypes ¶
type RelationCollection ¶
type RelationCollection []Relation
func (RelationCollection) Select ¶
func (c RelationCollection) Select(args ...any) RelationCollection
Select the relations matching the given signature prefix arguments. Match all if no arguments are given.
func (RelationCollection) Show ¶
func (rc RelationCollection) Show()
func (RelationCollection) Union ¶
func (c RelationCollection) Union() Relation
type RelationV1 ¶
type RelationV1 struct { RelKey RelKey `json:"rel_key"` Columns [][]interface{} `json:"columns"` }
func (*RelationV1) GetRow ¶
func (r *RelationV1) GetRow(n int) []interface{}
func (*RelationV1) Name ¶
func (r *RelationV1) Name() string
func (*RelationV1) RowCount ¶
func (r *RelationV1) RowCount() int
func (*RelationV1) Schema ¶
func (r *RelationV1) Schema() string
func (*RelationV1) Show ¶
func (r *RelationV1) Show()
type SimpleColumn ¶
type SimpleColumn[T SimpleTypes] interface { DataColumn[T] GetItem(int, *T) }
SimpleColumn is a DataColumn with a typed placement accessor for simple types.
type SimpleTypes ¶
type SnowflakeCredentials ¶
type SnowflakeDataStream ¶
type SnowflakeDataStream struct { Account string `json:"account"` // partition key ID string `json:"id"` Name string `json:"name"` // database.schema.object Integration string `json:"integration"` DbLink string `json:"dbLink"` CreatedBy string `json:"createdBy"` CreatedOn string `json:"createdOn"` State string `json:"state"` Snowflake struct { Database string `json:"database"` Schema string `json:"schema"` Object string `json:"object"` // fully qualified object name } `json:"snowflake"` RAI struct { Database string `json:"database"` Relation string `json:"relation"` } `json:"rai"` }
type SnowflakeDataStreamStatus ¶
type SnowflakeDataStreamStatus struct { ID string `json:"id"` SnowflakeUnloadStart int64 `json:"snowflakeUnloadStart"` // time of stream actions started from snowflake RaiLoadEnd int64 `json:"raiLoadEnd"` // time of stream actions complete Name string `json:"name"` // integration + dataStream name Account string `json:"account"` }
type SnowflakeDatabaseLink ¶
type SnowflakeDatabaseLink struct { ID string `json:"id"` Name string `json:"name"` // database.schema Account string `json:"account"` CreatedBy string `json:"createdBy"` CreatedOn string `json:"createdOn"` State string `json:"state"` Integration string `json:"integration"` Snowflake struct { Database string `json:"database"` Schema string `json:"schema"` Role string `json:"role"` } `json:"snowflake"` }
type Tabular ¶
type Tabular interface { Column Column(int) Column Columns() []Column GetRow(int, []any) NumCols() int Row(int) []any Signature() Signature Strings(int) []string }
Tabular is a generic interface to a sequence of columns of data with a type siganture.
type TabularColumn ¶
type TabularColumn[T any] interface { DataColumn[[]T] GetItem(int, []T) NumCols() int Strings(int) []string }
TabularColumn is a DataColumn with a typed placement accessor for composite types.
type Transaction ¶
type Transaction struct { ID string `json:"id"` AccountName string `json:"account_name,omitempty"` Database string `json:"database_name,omitempty"` Query string `json:"query,omitempty"` State TransactionState `json:"state"` ReadOnly bool `json:"read_only,omitempty"` CreatedBy string `json:"created_by,omitempty"` CreatedOn int64 `json:"created_on,omitempty"` FinishedAt int64 `json:"finished_at,omitempty"` LastRequestedInterval int64 `json:"last_requested_interval,omitempty"` }
type TransactionMetadata ¶
type TransactionMetadata struct { Info *pb.MetadataInfo // protobuf metadata // contains filtered or unexported fields }
func (TransactionMetadata) Signature ¶
func (m TransactionMetadata) Signature(id string) Signature
Returns the metadata signature corresponding to the given `id`, and nil if the requested `id` does not exist.
func (TransactionMetadata) Signatures ¶
func (m TransactionMetadata) Signatures() map[string]Signature
Returns a mapping from relation `id` to metadata signature.
type TransactionRequest ¶
type TransactionResponse ¶
type TransactionResponse struct { Transaction Transaction Metadata *TransactionMetadata Partitions map[string]*Partition Problems []Problem // todo: move to relational rep // contains filtered or unexported fields }
func ReadTransactionResponse ¶
func ReadTransactionResponse(rsp *http.Response) (*TransactionResponse, error)
Returns the results of a fast path response, which will contain data for the transaction resource, problems, metadata and results in various parts of the multipart response.
func (*TransactionResponse) EnsureMetadata ¶
func (t *TransactionResponse) EnsureMetadata(c *Client) (*TransactionMetadata, error)
func (*TransactionResponse) EnsureProblems ¶
func (t *TransactionResponse) EnsureProblems(c *Client) ([]Problem, error)
func (*TransactionResponse) EnsureResults ¶
func (t *TransactionResponse) EnsureResults(c *Client) (map[string]*Partition, error)
func (*TransactionResponse) Partition ¶
func (t *TransactionResponse) Partition(id string) *Partition
func (*TransactionResponse) Relation ¶
func (t *TransactionResponse) Relation(id string) Relation
func (*TransactionResponse) Relations ¶
func (t *TransactionResponse) Relations(args ...any) RelationCollection
Returns a collection of relations whose signature matches any of the optional prefix arguments, where value "_" in the prefix matches any value in the corresponding signature position.
func (*TransactionResponse) Show ¶
func (rsp *TransactionResponse) Show()
func (TransactionResponse) Signature ¶
func (t TransactionResponse) Signature(id string) Signature
Returns the type signature corresponding to the given relation ID.
type TransactionResult ¶
type TransactionResult struct { Aborted bool `json:"aborted"` Output []RelationV1 `json:"output"` Problems []ProblemV1 `json:"problems"` }
func (*TransactionResult) Show ¶
func (tx *TransactionResult) Show()
type TransactionState ¶
type TransactionState string
const ( Created TransactionState = "CREATED" // Created, queued for execution Running TransactionState = "RUNNING" Completed TransactionState = "COMPLETED" Aborted TransactionState = "ABORTED" )
type TransactionV1 ¶
type TransactionV1 struct { Region string Database string Engine string Mode string Source string Abort bool Readonly bool NoWaitDurable bool Version int }
The transaction "request" envelope
func NewTransaction ¶
func NewTransaction(region, database, engine, mode string) *TransactionV1
func (*TransactionV1) Payload ¶
func (tx *TransactionV1) Payload(actions ...DbAction) map[string]interface{}
Constructs a transaction request payload.
func (*TransactionV1) QueryArgs ¶
func (tx *TransactionV1) QueryArgs() url.Values
type Unspecified ¶
type Unspecified struct{}