Documentation ¶
Index ¶
- Constants
- func GetServiceAndContextForManager(manager dsc.Manager) (*bigquery.Service, context.Context, error)
- type ColumnInfo
- type Compressed
- type InsertTask
- func (it *InsertTask) Insert(reader io.Reader) error
- func (it *InsertTask) InsertAll(data interface{}) (int, error)
- func (it *InsertTask) InsertSingle(record map[string]interface{}) error
- func (it *InsertTask) LoadAll(data interface{}) (int, error)
- func (it *InsertTask) StreamAll(data interface{}) (int, error)
- type QueryIterator
- type QueryResultInfo
Constants ¶
const ( ServiceAccountIdKey = "serviceAccountId" PrivateKey = "privateKey" PrivateKeyPathKey = "privateKeyPath" ProjectIDKey = "projectId" DataSetIDKey = "datasetId" DateFormatKey = "dateFormat" MaxResultsKey = "maxResults" )
const ( InsertMethodStream = "stream" InsertMethodLoad = "load" InsertWaitTimeoutInMsKey = "insertWaitTimeoutInMs" InsertIdColumn = "insertIdColumn" StreamBatchCount = "streamBatchCount" //can not be more than 10000 InsertMaxRetires = "insertMaxRetires" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ColumnInfo ¶ added in v0.2.1
type Compressed ¶ added in v0.2.0
type Compressed struct {
// contains filtered or unexported fields
}
Compressed represent compressed encoded payload
func NewCompressed ¶ added in v0.2.0
func NewCompressed(encoderFactory toolbox.EncoderFactory) *Compressed
NewCompressed return new compressed struct
func (*Compressed) Append ¶ added in v0.2.0
func (c *Compressed) Append(data map[string]interface{}) error
Append append data to compressing stream
func (*Compressed) GetAndClose ¶ added in v0.2.0
func (c *Compressed) GetAndClose() (io.Reader, error)
GetAndClose returns reader and cloases the stream
type InsertTask ¶
type InsertTask struct {
// contains filtered or unexported fields
}
InsertTask represents insert streaming task.
func NewInsertTask ¶
func NewInsertTask(manager dsc.Manager, table *dsc.TableDescriptor, waitForCompletion bool) (*InsertTask, error)
NewInsertTask creates a new streaming insert task, it takes manager, table descript with schema, waitForCompletion flag with time duration.
func (*InsertTask) Insert ¶ added in v0.2.0
func (it *InsertTask) Insert(reader io.Reader) error
InsertAll streams all records into big query, returns number records streamed or error.
func (*InsertTask) InsertAll ¶
func (it *InsertTask) InsertAll(data interface{}) (int, error)
InsertAll streams or load all records into big query, returns number records streamed or error.
func (*InsertTask) InsertSingle ¶
func (it *InsertTask) InsertSingle(record map[string]interface{}) error
InsertSingle streams single records into big query.
func (*InsertTask) LoadAll ¶ added in v0.2.0
func (it *InsertTask) LoadAll(data interface{}) (int, error)
InsertAll streams all records into big query, returns number records streamed or error.
func (*InsertTask) StreamAll ¶ added in v0.2.0
func (it *InsertTask) StreamAll(data interface{}) (int, error)
InsertAll streams all records into big query, returns number records streamed or error.
type QueryIterator ¶
type QueryIterator struct { Rows []*bigquery.TableRow // contains filtered or unexported fields }
QueryIterator represetns a QueryIterator.
func NewQueryIterator ¶
func NewQueryIterator(manager dsc.Manager, query string) (*QueryIterator, error)
NewQueryIterator creates a new query iterator for passed in datastore manager and query.
func (*QueryIterator) GetColumnTypes ¶ added in v0.8.0
func (qi *QueryIterator) GetColumnTypes() ([]dsc.ColumnType, error)
GetColumns returns query columns, after query executed.
func (*QueryIterator) GetColumns ¶
func (qi *QueryIterator) GetColumns() ([]string, error)
GetColumns returns query columns, after query executed.
func (*QueryIterator) HasNext ¶
func (qi *QueryIterator) HasNext() bool
HasNext returns true if there is next row to fetch.
func (*QueryIterator) Next ¶
func (qi *QueryIterator) Next() ([]interface{}, error)
Next returns next row.
type QueryResultInfo ¶ added in v0.2.0
Represents query result into
func (*QueryResultInfo) Set ¶ added in v0.7.0
func (i *QueryResultInfo) Set(info *QueryResultInfo)
Set sets info values