Documentation
¶
Overview ¶
Package scrapper is a generated GoMock package.
Index ¶
- Constants
- Variables
- func As[T any](s Scrapper) (T, bool)
- func GetTableRowOption[T any](tableRow *TableRow, optionName string) T
- func IsValidString(s string) bool
- func SanitizeString(s string) string
- func SanitizeStringPtr(s *string)
- type Annotation
- type BigIntValue
- type Capabilities
- type CatalogColumnRow
- type ColumnValue
- type CustomMetricsRow
- type DatabaseRow
- type DoubleValue
- type DwhFqn
- type HasTableFqn
- type IgnoredValue
- type IntValue
- type MockScrapper
- func (m *MockScrapper) Capabilities() Capabilities
- func (m *MockScrapper) Close() error
- func (m *MockScrapper) DialectType() string
- func (m *MockScrapper) EXPECT() *MockScrapperMockRecorder
- func (m *MockScrapper) IsPermissionError(err error) bool
- func (m *MockScrapper) QueryCatalog(ctx context.Context) ([]*CatalogColumnRow, error)
- func (m *MockScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*CustomMetricsRow, error)
- func (m *MockScrapper) QueryDatabases(ctx context.Context) ([]*DatabaseRow, error)
- func (m *MockScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*SegmentRow, error)
- func (m *MockScrapper) QueryShape(ctx context.Context, sql string) ([]*QueryShapeColumn, error)
- func (m *MockScrapper) QuerySqlDefinitions(ctx context.Context) ([]*SqlDefinitionRow, error)
- func (m *MockScrapper) QueryTableConstraints(ctx context.Context) ([]*TableConstraintRow, error)
- func (m *MockScrapper) QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*TableMetricsRow, error)
- func (m *MockScrapper) QueryTables(ctx context.Context, opts ...QueryTablesOption) ([]*TableRow, error)
- func (m *MockScrapper) RunRawQuery(ctx context.Context, sql string) (RawQueryRowIterator, error)
- func (m *MockScrapper) SqlDialect() sqldialect.Dialect
- func (m *MockScrapper) ValidateConfiguration(ctx context.Context) ([]string, error)
- type MockScrapperCapabilitiesCall
- type MockScrapperCloseCall
- type MockScrapperDialectTypeCall
- type MockScrapperIsPermissionErrorCall
- func (c *MockScrapperIsPermissionErrorCall) Do(f func(error) bool) *MockScrapperIsPermissionErrorCall
- func (c *MockScrapperIsPermissionErrorCall) DoAndReturn(f func(error) bool) *MockScrapperIsPermissionErrorCall
- func (c *MockScrapperIsPermissionErrorCall) Return(arg0 bool) *MockScrapperIsPermissionErrorCall
- type MockScrapperMockRecorder
- func (mr *MockScrapperMockRecorder) Capabilities() *MockScrapperCapabilitiesCall
- func (mr *MockScrapperMockRecorder) Close() *MockScrapperCloseCall
- func (mr *MockScrapperMockRecorder) DialectType() *MockScrapperDialectTypeCall
- func (mr *MockScrapperMockRecorder) IsPermissionError(err any) *MockScrapperIsPermissionErrorCall
- func (mr *MockScrapperMockRecorder) QueryCatalog(ctx any) *MockScrapperQueryCatalogCall
- func (mr *MockScrapperMockRecorder) QueryCustomMetrics(ctx, sql any, args ...any) *MockScrapperQueryCustomMetricsCall
- func (mr *MockScrapperMockRecorder) QueryDatabases(ctx any) *MockScrapperQueryDatabasesCall
- func (mr *MockScrapperMockRecorder) QuerySegments(ctx, sql any, args ...any) *MockScrapperQuerySegmentsCall
- func (mr *MockScrapperMockRecorder) QueryShape(ctx, sql any) *MockScrapperQueryShapeCall
- func (mr *MockScrapperMockRecorder) QuerySqlDefinitions(ctx any) *MockScrapperQuerySqlDefinitionsCall
- func (mr *MockScrapperMockRecorder) QueryTableConstraints(ctx any) *MockScrapperQueryTableConstraintsCall
- func (mr *MockScrapperMockRecorder) QueryTableMetrics(ctx, lastMetricsFetchTime any) *MockScrapperQueryTableMetricsCall
- func (mr *MockScrapperMockRecorder) QueryTables(ctx any, opts ...any) *MockScrapperQueryTablesCall
- func (mr *MockScrapperMockRecorder) RunRawQuery(ctx, sql any) *MockScrapperRunRawQueryCall
- func (mr *MockScrapperMockRecorder) SqlDialect() *MockScrapperSqlDialectCall
- func (mr *MockScrapperMockRecorder) ValidateConfiguration(ctx any) *MockScrapperValidateConfigurationCall
- type MockScrapperQueryCatalogCall
- func (c *MockScrapperQueryCatalogCall) Do(f func(context.Context) ([]*CatalogColumnRow, error)) *MockScrapperQueryCatalogCall
- func (c *MockScrapperQueryCatalogCall) DoAndReturn(f func(context.Context) ([]*CatalogColumnRow, error)) *MockScrapperQueryCatalogCall
- func (c *MockScrapperQueryCatalogCall) Return(arg0 []*CatalogColumnRow, arg1 error) *MockScrapperQueryCatalogCall
- type MockScrapperQueryCustomMetricsCall
- func (c *MockScrapperQueryCustomMetricsCall) Do(f func(context.Context, string, ...any) ([]*CustomMetricsRow, error)) *MockScrapperQueryCustomMetricsCall
- func (c *MockScrapperQueryCustomMetricsCall) DoAndReturn(f func(context.Context, string, ...any) ([]*CustomMetricsRow, error)) *MockScrapperQueryCustomMetricsCall
- func (c *MockScrapperQueryCustomMetricsCall) Return(arg0 []*CustomMetricsRow, arg1 error) *MockScrapperQueryCustomMetricsCall
- type MockScrapperQueryDatabasesCall
- func (c *MockScrapperQueryDatabasesCall) Do(f func(context.Context) ([]*DatabaseRow, error)) *MockScrapperQueryDatabasesCall
- func (c *MockScrapperQueryDatabasesCall) DoAndReturn(f func(context.Context) ([]*DatabaseRow, error)) *MockScrapperQueryDatabasesCall
- func (c *MockScrapperQueryDatabasesCall) Return(arg0 []*DatabaseRow, arg1 error) *MockScrapperQueryDatabasesCall
- type MockScrapperQuerySegmentsCall
- func (c *MockScrapperQuerySegmentsCall) Do(f func(context.Context, string, ...any) ([]*SegmentRow, error)) *MockScrapperQuerySegmentsCall
- func (c *MockScrapperQuerySegmentsCall) DoAndReturn(f func(context.Context, string, ...any) ([]*SegmentRow, error)) *MockScrapperQuerySegmentsCall
- func (c *MockScrapperQuerySegmentsCall) Return(arg0 []*SegmentRow, arg1 error) *MockScrapperQuerySegmentsCall
- type MockScrapperQueryShapeCall
- func (c *MockScrapperQueryShapeCall) Do(f func(context.Context, string) ([]*QueryShapeColumn, error)) *MockScrapperQueryShapeCall
- func (c *MockScrapperQueryShapeCall) DoAndReturn(f func(context.Context, string) ([]*QueryShapeColumn, error)) *MockScrapperQueryShapeCall
- func (c *MockScrapperQueryShapeCall) Return(arg0 []*QueryShapeColumn, arg1 error) *MockScrapperQueryShapeCall
- type MockScrapperQuerySqlDefinitionsCall
- func (c *MockScrapperQuerySqlDefinitionsCall) Do(f func(context.Context) ([]*SqlDefinitionRow, error)) *MockScrapperQuerySqlDefinitionsCall
- func (c *MockScrapperQuerySqlDefinitionsCall) DoAndReturn(f func(context.Context) ([]*SqlDefinitionRow, error)) *MockScrapperQuerySqlDefinitionsCall
- func (c *MockScrapperQuerySqlDefinitionsCall) Return(arg0 []*SqlDefinitionRow, arg1 error) *MockScrapperQuerySqlDefinitionsCall
- type MockScrapperQueryTableConstraintsCall
- func (c *MockScrapperQueryTableConstraintsCall) Do(f func(context.Context) ([]*TableConstraintRow, error)) *MockScrapperQueryTableConstraintsCall
- func (c *MockScrapperQueryTableConstraintsCall) DoAndReturn(f func(context.Context) ([]*TableConstraintRow, error)) *MockScrapperQueryTableConstraintsCall
- func (c *MockScrapperQueryTableConstraintsCall) Return(arg0 []*TableConstraintRow, arg1 error) *MockScrapperQueryTableConstraintsCall
- type MockScrapperQueryTableMetricsCall
- func (c *MockScrapperQueryTableMetricsCall) Do(f func(context.Context, time.Time) ([]*TableMetricsRow, error)) *MockScrapperQueryTableMetricsCall
- func (c *MockScrapperQueryTableMetricsCall) DoAndReturn(f func(context.Context, time.Time) ([]*TableMetricsRow, error)) *MockScrapperQueryTableMetricsCall
- func (c *MockScrapperQueryTableMetricsCall) Return(arg0 []*TableMetricsRow, arg1 error) *MockScrapperQueryTableMetricsCall
- type MockScrapperQueryTablesCall
- func (c *MockScrapperQueryTablesCall) Do(f func(context.Context, ...QueryTablesOption) ([]*TableRow, error)) *MockScrapperQueryTablesCall
- func (c *MockScrapperQueryTablesCall) DoAndReturn(f func(context.Context, ...QueryTablesOption) ([]*TableRow, error)) *MockScrapperQueryTablesCall
- func (c *MockScrapperQueryTablesCall) Return(arg0 []*TableRow, arg1 error) *MockScrapperQueryTablesCall
- type MockScrapperRunRawQueryCall
- func (c *MockScrapperRunRawQueryCall) Do(f func(context.Context, string) (RawQueryRowIterator, error)) *MockScrapperRunRawQueryCall
- func (c *MockScrapperRunRawQueryCall) DoAndReturn(f func(context.Context, string) (RawQueryRowIterator, error)) *MockScrapperRunRawQueryCall
- func (c *MockScrapperRunRawQueryCall) Return(arg0 RawQueryRowIterator, arg1 error) *MockScrapperRunRawQueryCall
- type MockScrapperSqlDialectCall
- type MockScrapperValidateConfigurationCall
- func (c *MockScrapperValidateConfigurationCall) Do(f func(context.Context) ([]string, error)) *MockScrapperValidateConfigurationCall
- func (c *MockScrapperValidateConfigurationCall) DoAndReturn(f func(context.Context) ([]string, error)) *MockScrapperValidateConfigurationCall
- func (c *MockScrapperValidateConfigurationCall) Return(warnings []string, err error) *MockScrapperValidateConfigurationCall
- type NoEnoughPermissionsError
- type QueryShapeColumn
- type QueryTablesConfig
- type QueryTablesOption
- type RawQueryRowIterator
- type SchemaColumnField
- type Scrapper
- type SegmentRow
- type SegmentValue
- type SqlDefinitionRow
- type StringValue
- type TableChangeEvent
- type TableChangeHistoryProvider
- type TableConstraintRow
- type TableMetricsRow
- type TableRow
- type Tag
- type TimeValue
- type Unwrapper
- type Value
- type WithSetInstance
Constants ¶
const ( ConstraintTypePrimaryKey = "PRIMARY KEY" ConstraintTypeUniqueIndex = "UNIQUE INDEX" ConstraintTypeIndex = "INDEX" ConstraintTypeSortingKey = "SORTING KEY" ConstraintTypePartitionBy = "PARTITION BY" ConstraintTypeClusterBy = "CLUSTER BY" ConstraintTypeDistributionKey = "DISTRIBUTION KEY" ConstraintTypeProjection = "PROJECTION" ConstraintTypeCheck = "CHECK" )
Constraint type constants
Variables ¶
var ErrUnsupported = errors.New("unsupported")
Functions ¶
func As ¶ added in v0.13.3
As walks the decorator chain rooted at s (following Unwrap) and returns the first value that type-asserts to T. Returns the zero T and false if no value in the chain satisfies T. Safe to call with a nil Scrapper.
func GetTableRowOption ¶ added in v0.4.13
func IsValidString ¶ added in v0.13.2
IsValidString reports whether s contains no NUL bytes and is valid UTF-8. Used both as the fast-path check in SanitizeString and as the identity-field validity predicate by the rejecting scrapper decorator.
func SanitizeString ¶ added in v0.13.2
SanitizeString drops NUL bytes and invalid UTF-8 sequences. Returns the input unchanged (no allocation) when it contains neither — the common case. Dropping rather than substituting (e.g. with U+FFFD) avoids visible replacement-character artifacts in downstream UIs that would otherwise surface data corruption to end users.
func SanitizeStringPtr ¶ added in v0.13.2
func SanitizeStringPtr(s *string)
SanitizeStringPtr applies SanitizeString through a *string, leaving nil pointers untouched.
Types ¶
type Annotation ¶ added in v0.4.12
type Annotation struct {
AnnotationName string `json:"annotation_name"`
AnnotationValue string `json:"annotation_value"`
}
func (*Annotation) HasValidIdentity ¶ added in v0.13.2
func (a *Annotation) HasValidIdentity() bool
func (*Annotation) Sanitize ¶ added in v0.13.2
func (a *Annotation) Sanitize()
type BigIntValue ¶ added in v0.9.0
BigIntValue represents arbitrary precision integers (e.g., DuckDB hugeint, uint128)
func NewBigIntValue ¶ added in v0.9.0
func NewBigIntValue(v *big.Int) *BigIntValue
NewBigIntValue creates a BigIntValue from a *big.Int
func (*BigIntValue) BigInt ¶ added in v0.9.0
func (v *BigIntValue) BigInt() *big.Int
BigInt returns the underlying *big.Int
func (*BigIntValue) String ¶ added in v0.9.0
func (v *BigIntValue) String() string
String returns the string representation of the big integer
type Capabilities ¶ added in v0.10.6
type Capabilities struct {
// ConstraintsViaQueryTables indicates that QueryTables with WithConstraints()
// populates TableRow.Constraints, making a separate QueryTableConstraints call unnecessary.
ConstraintsViaQueryTables bool
}
Capabilities describes what a scrapper supports beyond the base interface. Callers can use this to skip redundant calls (e.g., skip QueryTableConstraints when constraints are already provided via QueryTables).
type CatalogColumnRow ¶
type CatalogColumnRow struct {
Instance string `db:"instance" json:"instance" ch:"instance" bigquery:"instance"`
Database string `db:"database" json:"database" ch:"_database" bigquery:"database"`
Schema string `db:"schema" json:"schema" ch:"schema" bigquery:"schema"`
Table string `db:"table" json:"table" ch:"table" bigquery:"table"`
IsView bool `db:"is_view" json:"is_view" ch:"is_view" bigquery:"is_view"`
IsTable bool `db:"is_table" json:"is_table" ch:"is_table" bigquery:"is_table"`
IsMaterializedView bool `db:"is_materialized_view" json:"is_materialized_view" ch:"is_materialized_view" bigquery:"is_materialized_view"`
TableType string `db:"table_type" json:"table_type" ch:"table_type" bigquery:"table_type"`
Column string `db:"column" json:"column" ch:"column" bigquery:"column"`
Type string `db:"type" json:"type" ch:"type" bigquery:"type"`
Position int32 `db:"position" json:"position" ch:"position" bigquery:"position"`
Comment *string `db:"comment" json:"comment" ch:"comment" bigquery:"comment"`
TableComment *string `db:"table_comment" json:"table_comment" ch:"table_comment" bigquery:"table_comment"`
ColumnTags []*Tag ` json:"column_tags"`
TableTags []*Tag ` json:"table_tags"`
IsStructColumn bool `db:"is_struct_column" json:"is_struct_column" ch:"is_struct_column" bigquery:"is_struct_column"`
IsArrayColumn bool `db:"is_array_column" json:"is_array_column" ch:"is_array_column" bigquery:"is_array_column"`
FieldSchemas []*SchemaColumnField
}
func (CatalogColumnRow) GetComment ¶
func (r CatalogColumnRow) GetComment() string
func (CatalogColumnRow) GetTableComment ¶
func (r CatalogColumnRow) GetTableComment() string
func (*CatalogColumnRow) HasValidIdentity ¶ added in v0.13.2
func (r *CatalogColumnRow) HasValidIdentity() bool
func (*CatalogColumnRow) Sanitize ¶ added in v0.13.2
func (r *CatalogColumnRow) Sanitize()
func (CatalogColumnRow) TableFqn ¶
func (r CatalogColumnRow) TableFqn() DwhFqn
type ColumnValue ¶
func (*ColumnValue) HasValidIdentity ¶ added in v0.13.2
func (v *ColumnValue) HasValidIdentity() bool
func (*ColumnValue) Sanitize ¶ added in v0.13.2
func (v *ColumnValue) Sanitize()
type CustomMetricsRow ¶
type CustomMetricsRow struct {
Segments []*SegmentValue
ColumnValues []*ColumnValue
}
func (*CustomMetricsRow) HasValidIdentity ¶ added in v0.13.2
func (r *CustomMetricsRow) HasValidIdentity() bool
HasValidIdentity on CustomMetricsRow requires every segment and column name to be valid; a single bad identifier changes the meaning of the whole row, so we drop rather than partially filter.
func (*CustomMetricsRow) Sanitize ¶ added in v0.13.2
func (r *CustomMetricsRow) Sanitize()
type DatabaseRow ¶
type DatabaseRow struct {
Instance string `db:"instance" json:"instance" ch:"instance" bigquery:"instance"`
Database string `db:"database" json:"database" ch:"_database" bigquery:"database"`
Description *string `db:"description" json:"description" ch:"description" bigquery:"description"`
DatabaseType *string `db:"database_type" json:"database_type" ch:"database_type" bigquery:"database_type"`
DatabaseOwner *string `db:"database_owner" json:"database_owner" ch:"database_owner" bigquery:"database_owner"`
}
func (*DatabaseRow) HasValidIdentity ¶ added in v0.13.2
func (r *DatabaseRow) HasValidIdentity() bool
func (*DatabaseRow) Sanitize ¶ added in v0.13.2
func (r *DatabaseRow) Sanitize()
func (*DatabaseRow) SetInstance ¶
func (r *DatabaseRow) SetInstance(instance string)
type DoubleValue ¶
type DoubleValue float64
type HasTableFqn ¶
type HasTableFqn interface {
TableFqn() DwhFqn
}
type IgnoredValue ¶
type IgnoredValue struct{}
type MockScrapper ¶ added in v0.4.7
type MockScrapper struct {
// contains filtered or unexported fields
}
MockScrapper is a mock of Scrapper interface.
func NewMockScrapper ¶ added in v0.4.7
func NewMockScrapper(ctrl *gomock.Controller) *MockScrapper
NewMockScrapper creates a new mock instance.
func (*MockScrapper) Capabilities ¶ added in v0.10.6
func (m *MockScrapper) Capabilities() Capabilities
Capabilities mocks base method.
func (*MockScrapper) Close ¶ added in v0.4.7
func (m *MockScrapper) Close() error
Close mocks base method.
func (*MockScrapper) DialectType ¶ added in v0.4.7
func (m *MockScrapper) DialectType() string
DialectType mocks base method.
func (*MockScrapper) EXPECT ¶ added in v0.4.7
func (m *MockScrapper) EXPECT() *MockScrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockScrapper) IsPermissionError ¶ added in v0.4.7
func (m *MockScrapper) IsPermissionError(err error) bool
IsPermissionError mocks base method.
func (*MockScrapper) QueryCatalog ¶ added in v0.4.7
func (m *MockScrapper) QueryCatalog(ctx context.Context) ([]*CatalogColumnRow, error)
QueryCatalog mocks base method.
func (*MockScrapper) QueryCustomMetrics ¶ added in v0.4.7
func (m *MockScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*CustomMetricsRow, error)
QueryCustomMetrics mocks base method.
func (*MockScrapper) QueryDatabases ¶ added in v0.4.7
func (m *MockScrapper) QueryDatabases(ctx context.Context) ([]*DatabaseRow, error)
QueryDatabases mocks base method.
func (*MockScrapper) QuerySegments ¶ added in v0.4.7
func (m *MockScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*SegmentRow, error)
QuerySegments mocks base method.
func (*MockScrapper) QueryShape ¶ added in v0.8.3
func (m *MockScrapper) QueryShape(ctx context.Context, sql string) ([]*QueryShapeColumn, error)
QueryShape mocks base method.
func (*MockScrapper) QuerySqlDefinitions ¶ added in v0.4.7
func (m *MockScrapper) QuerySqlDefinitions(ctx context.Context) ([]*SqlDefinitionRow, error)
QuerySqlDefinitions mocks base method.
func (*MockScrapper) QueryTableConstraints ¶ added in v0.9.0
func (m *MockScrapper) QueryTableConstraints(ctx context.Context) ([]*TableConstraintRow, error)
QueryTableConstraints mocks base method.
func (*MockScrapper) QueryTableMetrics ¶ added in v0.4.7
func (m *MockScrapper) QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*TableMetricsRow, error)
QueryTableMetrics mocks base method.
func (*MockScrapper) QueryTables ¶ added in v0.4.7
func (m *MockScrapper) QueryTables(ctx context.Context, opts ...QueryTablesOption) ([]*TableRow, error)
QueryTables mocks base method.
func (*MockScrapper) RunRawQuery ¶ added in v0.13.7
func (m *MockScrapper) RunRawQuery(ctx context.Context, sql string) (RawQueryRowIterator, error)
RunRawQuery mocks base method.
func (*MockScrapper) SqlDialect ¶ added in v0.4.7
func (m *MockScrapper) SqlDialect() sqldialect.Dialect
SqlDialect mocks base method.
func (*MockScrapper) ValidateConfiguration ¶ added in v0.4.7
func (m *MockScrapper) ValidateConfiguration(ctx context.Context) ([]string, error)
ValidateConfiguration mocks base method.
type MockScrapperCapabilitiesCall ¶ added in v0.10.6
MockScrapperCapabilitiesCall wrap *gomock.Call
func (*MockScrapperCapabilitiesCall) Do ¶ added in v0.10.6
func (c *MockScrapperCapabilitiesCall) Do(f func() Capabilities) *MockScrapperCapabilitiesCall
Do rewrite *gomock.Call.Do
func (*MockScrapperCapabilitiesCall) DoAndReturn ¶ added in v0.10.6
func (c *MockScrapperCapabilitiesCall) DoAndReturn(f func() Capabilities) *MockScrapperCapabilitiesCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperCapabilitiesCall) Return ¶ added in v0.10.6
func (c *MockScrapperCapabilitiesCall) Return(arg0 Capabilities) *MockScrapperCapabilitiesCall
Return rewrite *gomock.Call.Return
type MockScrapperCloseCall ¶ added in v0.4.7
MockScrapperCloseCall wrap *gomock.Call
func (*MockScrapperCloseCall) Do ¶ added in v0.4.7
func (c *MockScrapperCloseCall) Do(f func() error) *MockScrapperCloseCall
Do rewrite *gomock.Call.Do
func (*MockScrapperCloseCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperCloseCall) DoAndReturn(f func() error) *MockScrapperCloseCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperCloseCall) Return ¶ added in v0.4.7
func (c *MockScrapperCloseCall) Return(arg0 error) *MockScrapperCloseCall
Return rewrite *gomock.Call.Return
type MockScrapperDialectTypeCall ¶ added in v0.4.7
MockScrapperDialectTypeCall wrap *gomock.Call
func (*MockScrapperDialectTypeCall) Do ¶ added in v0.4.7
func (c *MockScrapperDialectTypeCall) Do(f func() string) *MockScrapperDialectTypeCall
Do rewrite *gomock.Call.Do
func (*MockScrapperDialectTypeCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperDialectTypeCall) DoAndReturn(f func() string) *MockScrapperDialectTypeCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperDialectTypeCall) Return ¶ added in v0.4.7
func (c *MockScrapperDialectTypeCall) Return(arg0 string) *MockScrapperDialectTypeCall
Return rewrite *gomock.Call.Return
type MockScrapperIsPermissionErrorCall ¶ added in v0.4.7
MockScrapperIsPermissionErrorCall wrap *gomock.Call
func (*MockScrapperIsPermissionErrorCall) Do ¶ added in v0.4.7
func (c *MockScrapperIsPermissionErrorCall) Do(f func(error) bool) *MockScrapperIsPermissionErrorCall
Do rewrite *gomock.Call.Do
func (*MockScrapperIsPermissionErrorCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperIsPermissionErrorCall) DoAndReturn(f func(error) bool) *MockScrapperIsPermissionErrorCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperIsPermissionErrorCall) Return ¶ added in v0.4.7
func (c *MockScrapperIsPermissionErrorCall) Return(arg0 bool) *MockScrapperIsPermissionErrorCall
Return rewrite *gomock.Call.Return
type MockScrapperMockRecorder ¶ added in v0.4.7
type MockScrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockScrapperMockRecorder is the mock recorder for MockScrapper.
func (*MockScrapperMockRecorder) Capabilities ¶ added in v0.10.6
func (mr *MockScrapperMockRecorder) Capabilities() *MockScrapperCapabilitiesCall
Capabilities indicates an expected call of Capabilities.
func (*MockScrapperMockRecorder) Close ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) Close() *MockScrapperCloseCall
Close indicates an expected call of Close.
func (*MockScrapperMockRecorder) DialectType ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) DialectType() *MockScrapperDialectTypeCall
DialectType indicates an expected call of DialectType.
func (*MockScrapperMockRecorder) IsPermissionError ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) IsPermissionError(err any) *MockScrapperIsPermissionErrorCall
IsPermissionError indicates an expected call of IsPermissionError.
func (*MockScrapperMockRecorder) QueryCatalog ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) QueryCatalog(ctx any) *MockScrapperQueryCatalogCall
QueryCatalog indicates an expected call of QueryCatalog.
func (*MockScrapperMockRecorder) QueryCustomMetrics ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) QueryCustomMetrics(ctx, sql any, args ...any) *MockScrapperQueryCustomMetricsCall
QueryCustomMetrics indicates an expected call of QueryCustomMetrics.
func (*MockScrapperMockRecorder) QueryDatabases ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) QueryDatabases(ctx any) *MockScrapperQueryDatabasesCall
QueryDatabases indicates an expected call of QueryDatabases.
func (*MockScrapperMockRecorder) QuerySegments ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) QuerySegments(ctx, sql any, args ...any) *MockScrapperQuerySegmentsCall
QuerySegments indicates an expected call of QuerySegments.
func (*MockScrapperMockRecorder) QueryShape ¶ added in v0.8.3
func (mr *MockScrapperMockRecorder) QueryShape(ctx, sql any) *MockScrapperQueryShapeCall
QueryShape indicates an expected call of QueryShape.
func (*MockScrapperMockRecorder) QuerySqlDefinitions ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) QuerySqlDefinitions(ctx any) *MockScrapperQuerySqlDefinitionsCall
QuerySqlDefinitions indicates an expected call of QuerySqlDefinitions.
func (*MockScrapperMockRecorder) QueryTableConstraints ¶ added in v0.9.0
func (mr *MockScrapperMockRecorder) QueryTableConstraints(ctx any) *MockScrapperQueryTableConstraintsCall
QueryTableConstraints indicates an expected call of QueryTableConstraints.
func (*MockScrapperMockRecorder) QueryTableMetrics ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) QueryTableMetrics(ctx, lastMetricsFetchTime any) *MockScrapperQueryTableMetricsCall
QueryTableMetrics indicates an expected call of QueryTableMetrics.
func (*MockScrapperMockRecorder) QueryTables ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) QueryTables(ctx any, opts ...any) *MockScrapperQueryTablesCall
QueryTables indicates an expected call of QueryTables.
func (*MockScrapperMockRecorder) RunRawQuery ¶ added in v0.13.7
func (mr *MockScrapperMockRecorder) RunRawQuery(ctx, sql any) *MockScrapperRunRawQueryCall
RunRawQuery indicates an expected call of RunRawQuery.
func (*MockScrapperMockRecorder) SqlDialect ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) SqlDialect() *MockScrapperSqlDialectCall
SqlDialect indicates an expected call of SqlDialect.
func (*MockScrapperMockRecorder) ValidateConfiguration ¶ added in v0.4.7
func (mr *MockScrapperMockRecorder) ValidateConfiguration(ctx any) *MockScrapperValidateConfigurationCall
ValidateConfiguration indicates an expected call of ValidateConfiguration.
type MockScrapperQueryCatalogCall ¶ added in v0.4.7
MockScrapperQueryCatalogCall wrap *gomock.Call
func (*MockScrapperQueryCatalogCall) Do ¶ added in v0.4.7
func (c *MockScrapperQueryCatalogCall) Do(f func(context.Context) ([]*CatalogColumnRow, error)) *MockScrapperQueryCatalogCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQueryCatalogCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperQueryCatalogCall) DoAndReturn(f func(context.Context) ([]*CatalogColumnRow, error)) *MockScrapperQueryCatalogCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQueryCatalogCall) Return ¶ added in v0.4.7
func (c *MockScrapperQueryCatalogCall) Return(arg0 []*CatalogColumnRow, arg1 error) *MockScrapperQueryCatalogCall
Return rewrite *gomock.Call.Return
type MockScrapperQueryCustomMetricsCall ¶ added in v0.4.7
MockScrapperQueryCustomMetricsCall wrap *gomock.Call
func (*MockScrapperQueryCustomMetricsCall) Do ¶ added in v0.4.7
func (c *MockScrapperQueryCustomMetricsCall) Do(f func(context.Context, string, ...any) ([]*CustomMetricsRow, error)) *MockScrapperQueryCustomMetricsCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQueryCustomMetricsCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperQueryCustomMetricsCall) DoAndReturn(f func(context.Context, string, ...any) ([]*CustomMetricsRow, error)) *MockScrapperQueryCustomMetricsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQueryCustomMetricsCall) Return ¶ added in v0.4.7
func (c *MockScrapperQueryCustomMetricsCall) Return(arg0 []*CustomMetricsRow, arg1 error) *MockScrapperQueryCustomMetricsCall
Return rewrite *gomock.Call.Return
type MockScrapperQueryDatabasesCall ¶ added in v0.4.7
MockScrapperQueryDatabasesCall wrap *gomock.Call
func (*MockScrapperQueryDatabasesCall) Do ¶ added in v0.4.7
func (c *MockScrapperQueryDatabasesCall) Do(f func(context.Context) ([]*DatabaseRow, error)) *MockScrapperQueryDatabasesCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQueryDatabasesCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperQueryDatabasesCall) DoAndReturn(f func(context.Context) ([]*DatabaseRow, error)) *MockScrapperQueryDatabasesCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQueryDatabasesCall) Return ¶ added in v0.4.7
func (c *MockScrapperQueryDatabasesCall) Return(arg0 []*DatabaseRow, arg1 error) *MockScrapperQueryDatabasesCall
Return rewrite *gomock.Call.Return
type MockScrapperQuerySegmentsCall ¶ added in v0.4.7
MockScrapperQuerySegmentsCall wrap *gomock.Call
func (*MockScrapperQuerySegmentsCall) Do ¶ added in v0.4.7
func (c *MockScrapperQuerySegmentsCall) Do(f func(context.Context, string, ...any) ([]*SegmentRow, error)) *MockScrapperQuerySegmentsCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQuerySegmentsCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperQuerySegmentsCall) DoAndReturn(f func(context.Context, string, ...any) ([]*SegmentRow, error)) *MockScrapperQuerySegmentsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQuerySegmentsCall) Return ¶ added in v0.4.7
func (c *MockScrapperQuerySegmentsCall) Return(arg0 []*SegmentRow, arg1 error) *MockScrapperQuerySegmentsCall
Return rewrite *gomock.Call.Return
type MockScrapperQueryShapeCall ¶ added in v0.8.3
MockScrapperQueryShapeCall wrap *gomock.Call
func (*MockScrapperQueryShapeCall) Do ¶ added in v0.8.3
func (c *MockScrapperQueryShapeCall) Do(f func(context.Context, string) ([]*QueryShapeColumn, error)) *MockScrapperQueryShapeCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQueryShapeCall) DoAndReturn ¶ added in v0.8.3
func (c *MockScrapperQueryShapeCall) DoAndReturn(f func(context.Context, string) ([]*QueryShapeColumn, error)) *MockScrapperQueryShapeCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQueryShapeCall) Return ¶ added in v0.8.3
func (c *MockScrapperQueryShapeCall) Return(arg0 []*QueryShapeColumn, arg1 error) *MockScrapperQueryShapeCall
Return rewrite *gomock.Call.Return
type MockScrapperQuerySqlDefinitionsCall ¶ added in v0.4.7
MockScrapperQuerySqlDefinitionsCall wrap *gomock.Call
func (*MockScrapperQuerySqlDefinitionsCall) Do ¶ added in v0.4.7
func (c *MockScrapperQuerySqlDefinitionsCall) Do(f func(context.Context) ([]*SqlDefinitionRow, error)) *MockScrapperQuerySqlDefinitionsCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQuerySqlDefinitionsCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperQuerySqlDefinitionsCall) DoAndReturn(f func(context.Context) ([]*SqlDefinitionRow, error)) *MockScrapperQuerySqlDefinitionsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQuerySqlDefinitionsCall) Return ¶ added in v0.4.7
func (c *MockScrapperQuerySqlDefinitionsCall) Return(arg0 []*SqlDefinitionRow, arg1 error) *MockScrapperQuerySqlDefinitionsCall
Return rewrite *gomock.Call.Return
type MockScrapperQueryTableConstraintsCall ¶ added in v0.9.0
MockScrapperQueryTableConstraintsCall wrap *gomock.Call
func (*MockScrapperQueryTableConstraintsCall) Do ¶ added in v0.9.0
func (c *MockScrapperQueryTableConstraintsCall) Do(f func(context.Context) ([]*TableConstraintRow, error)) *MockScrapperQueryTableConstraintsCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQueryTableConstraintsCall) DoAndReturn ¶ added in v0.9.0
func (c *MockScrapperQueryTableConstraintsCall) DoAndReturn(f func(context.Context) ([]*TableConstraintRow, error)) *MockScrapperQueryTableConstraintsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQueryTableConstraintsCall) Return ¶ added in v0.9.0
func (c *MockScrapperQueryTableConstraintsCall) Return(arg0 []*TableConstraintRow, arg1 error) *MockScrapperQueryTableConstraintsCall
Return rewrite *gomock.Call.Return
type MockScrapperQueryTableMetricsCall ¶ added in v0.4.7
MockScrapperQueryTableMetricsCall wrap *gomock.Call
func (*MockScrapperQueryTableMetricsCall) Do ¶ added in v0.4.7
func (c *MockScrapperQueryTableMetricsCall) Do(f func(context.Context, time.Time) ([]*TableMetricsRow, error)) *MockScrapperQueryTableMetricsCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQueryTableMetricsCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperQueryTableMetricsCall) DoAndReturn(f func(context.Context, time.Time) ([]*TableMetricsRow, error)) *MockScrapperQueryTableMetricsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQueryTableMetricsCall) Return ¶ added in v0.4.7
func (c *MockScrapperQueryTableMetricsCall) Return(arg0 []*TableMetricsRow, arg1 error) *MockScrapperQueryTableMetricsCall
Return rewrite *gomock.Call.Return
type MockScrapperQueryTablesCall ¶ added in v0.4.7
MockScrapperQueryTablesCall wrap *gomock.Call
func (*MockScrapperQueryTablesCall) Do ¶ added in v0.4.7
func (c *MockScrapperQueryTablesCall) Do(f func(context.Context, ...QueryTablesOption) ([]*TableRow, error)) *MockScrapperQueryTablesCall
Do rewrite *gomock.Call.Do
func (*MockScrapperQueryTablesCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperQueryTablesCall) DoAndReturn(f func(context.Context, ...QueryTablesOption) ([]*TableRow, error)) *MockScrapperQueryTablesCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperQueryTablesCall) Return ¶ added in v0.4.7
func (c *MockScrapperQueryTablesCall) Return(arg0 []*TableRow, arg1 error) *MockScrapperQueryTablesCall
Return rewrite *gomock.Call.Return
type MockScrapperRunRawQueryCall ¶ added in v0.13.7
MockScrapperRunRawQueryCall wrap *gomock.Call
func (*MockScrapperRunRawQueryCall) Do ¶ added in v0.13.7
func (c *MockScrapperRunRawQueryCall) Do(f func(context.Context, string) (RawQueryRowIterator, error)) *MockScrapperRunRawQueryCall
Do rewrite *gomock.Call.Do
func (*MockScrapperRunRawQueryCall) DoAndReturn ¶ added in v0.13.7
func (c *MockScrapperRunRawQueryCall) DoAndReturn(f func(context.Context, string) (RawQueryRowIterator, error)) *MockScrapperRunRawQueryCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperRunRawQueryCall) Return ¶ added in v0.13.7
func (c *MockScrapperRunRawQueryCall) Return(arg0 RawQueryRowIterator, arg1 error) *MockScrapperRunRawQueryCall
Return rewrite *gomock.Call.Return
type MockScrapperSqlDialectCall ¶ added in v0.4.7
MockScrapperSqlDialectCall wrap *gomock.Call
func (*MockScrapperSqlDialectCall) Do ¶ added in v0.4.7
func (c *MockScrapperSqlDialectCall) Do(f func() sqldialect.Dialect) *MockScrapperSqlDialectCall
Do rewrite *gomock.Call.Do
func (*MockScrapperSqlDialectCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperSqlDialectCall) DoAndReturn(f func() sqldialect.Dialect) *MockScrapperSqlDialectCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperSqlDialectCall) Return ¶ added in v0.4.7
func (c *MockScrapperSqlDialectCall) Return(arg0 sqldialect.Dialect) *MockScrapperSqlDialectCall
Return rewrite *gomock.Call.Return
type MockScrapperValidateConfigurationCall ¶ added in v0.4.7
MockScrapperValidateConfigurationCall wrap *gomock.Call
func (*MockScrapperValidateConfigurationCall) Do ¶ added in v0.4.7
func (c *MockScrapperValidateConfigurationCall) Do(f func(context.Context) ([]string, error)) *MockScrapperValidateConfigurationCall
Do rewrite *gomock.Call.Do
func (*MockScrapperValidateConfigurationCall) DoAndReturn ¶ added in v0.4.7
func (c *MockScrapperValidateConfigurationCall) DoAndReturn(f func(context.Context) ([]string, error)) *MockScrapperValidateConfigurationCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockScrapperValidateConfigurationCall) Return ¶ added in v0.4.7
func (c *MockScrapperValidateConfigurationCall) Return(warnings []string, err error) *MockScrapperValidateConfigurationCall
Return rewrite *gomock.Call.Return
type NoEnoughPermissionsError ¶
type NoEnoughPermissionsError struct {
Err error
}
func NewNoEnoughPermissionsError ¶
func NewNoEnoughPermissionsError(err error) *NoEnoughPermissionsError
func (*NoEnoughPermissionsError) Error ¶
func (r *NoEnoughPermissionsError) Error() string
type QueryShapeColumn ¶ added in v0.8.3
type QueryShapeColumn struct {
Name string `json:"name"`
NativeType string `json:"native_type"`
Position int32 `json:"position"`
}
func (*QueryShapeColumn) HasValidIdentity ¶ added in v0.13.2
func (c *QueryShapeColumn) HasValidIdentity() bool
func (*QueryShapeColumn) Sanitize ¶ added in v0.13.2
func (c *QueryShapeColumn) Sanitize()
type QueryTablesConfig ¶ added in v0.10.6
type QueryTablesConfig struct {
IncludeConstraints bool
}
QueryTablesConfig holds options for QueryTables.
func ApplyQueryTablesOptions ¶ added in v0.10.6
func ApplyQueryTablesOptions(opts ...QueryTablesOption) QueryTablesConfig
ApplyQueryTablesOptions applies the given options to a QueryTablesConfig.
type QueryTablesOption ¶ added in v0.10.6
type QueryTablesOption func(*QueryTablesConfig)
QueryTablesOption configures QueryTables behavior.
func WithConstraints ¶ added in v0.10.6
func WithConstraints() QueryTablesOption
WithConstraints instructs QueryTables to include table constraints (partitioning, clustering, etc.) in the returned TableRow.Constraints field. This avoids the need for a separate QueryTableConstraints call when the scrapper already fetches the necessary metadata as part of QueryTables.
type RawQueryRowIterator ¶ added in v0.13.7
type RawQueryRowIterator interface {
// Columns describes the shape of the result. Stable for the lifetime of
// the iterator — valid before the first Next call and unchanged after.
Columns() []*QueryShapeColumn
// Next returns the next row or io.EOF when exhausted.
//
// The returned slice is positional with Columns(); each cell is a fresh
// *ColumnValue the caller may retain. NULL cells have IsNull=true and
// Value=nil.
//
// Implementations MUST auto-close resources before returning io.EOF.
// Safe to call after EOF (keeps returning io.EOF).
Next(ctx context.Context) ([]*ColumnValue, error)
// Close releases the underlying cursor / driver rows / warehouse job.
// Safe to call multiple times.
Close() error
}
RawQueryRowIterator streams typed rows from RunRawQuery. Semantics mirror querylogs.QueryLogIterator: Next returns io.EOF when exhausted, auto-closes on EOF, and Close is idempotent.
type SchemaColumnField ¶
type SchemaColumnField struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Human readable name of the column as present in dbt or data warehouse.
HumanName string `protobuf:"bytes,2,opt,name=human_name,json=humanName,proto3" json:"human_name,omitempty"`
// Native data type of the column as present in data warehouse.
NativeType string `protobuf:"bytes,4,opt,name=native_type,json=nativeType,proto3" json:"native_type,omitempty"`
// Description of the column
Description *string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
// Ordinal position of the column in the table, starting from 1
OrdinalPosition int32 `protobuf:"varint,6,opt,name=ordinal_position,json=ordinalPosition,proto3" json:"ordinal_position,omitempty"`
// Indicates that the column type could be used as a struct/json in a data warehouse
IsStruct bool `protobuf:"varint,7,opt,name=is_struct,json=isStruct,proto3" json:"is_struct,omitempty"`
// Indicates that the column is a repeated field in a data warehouse (e.g. array)
IsRepeated bool `protobuf:"varint,8,opt,name=is_repeated,json=isRepeated,proto3" json:"is_repeated,omitempty"`
// Fields inside of the struct/record like column
Fields []*SchemaColumnField `protobuf:"bytes,9,rep,name=fields,proto3" json:"fields,omitempty"`
}
func (*SchemaColumnField) HasValidIdentity ¶ added in v0.13.2
func (f *SchemaColumnField) HasValidIdentity() bool
func (*SchemaColumnField) Sanitize ¶ added in v0.13.2
func (f *SchemaColumnField) Sanitize()
type Scrapper ¶
type Scrapper interface {
DialectType() string
SqlDialect() sqldialect.Dialect
IsPermissionError(err error) bool
// Capabilities returns what this scrapper supports beyond the base interface.
Capabilities() Capabilities
ValidateConfiguration(ctx context.Context) (warnings []string, err error)
QueryCatalog(ctx context.Context) ([]*CatalogColumnRow, error)
QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*TableMetricsRow, error)
QuerySqlDefinitions(ctx context.Context) ([]*SqlDefinitionRow, error)
QueryTables(ctx context.Context, opts ...QueryTablesOption) ([]*TableRow, error)
QueryDatabases(ctx context.Context) ([]*DatabaseRow, error)
QuerySegments(ctx context.Context, sql string, args ...any) ([]*SegmentRow, error)
QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*CustomMetricsRow, error)
QueryShape(ctx context.Context, sql string) ([]*QueryShapeColumn, error)
// RunRawQuery executes an arbitrary user-supplied SELECT and returns a
// streaming iterator over typed rows. Unlike QueryCustomMetrics it does
// not filter segment* columns and does not collapse text columns to
// IgnoredValue — it is designed for generic "run this query" surfaces
// rather than the agent's metrics/profile/segments path.
//
// The caller must Close() the iterator. Callers that want a row cap
// should stop iteration after N calls to Next().
RunRawQuery(ctx context.Context, sql string) (RawQueryRowIterator, error)
QueryTableConstraints(ctx context.Context) ([]*TableConstraintRow, error)
// This will close underlying execer, such scrapper can't be used anymore
Close() error
}
type SegmentRow ¶
func (*SegmentRow) HasValidIdentity ¶ added in v0.13.2
func (r *SegmentRow) HasValidIdentity() bool
func (*SegmentRow) Sanitize ¶ added in v0.13.2
func (r *SegmentRow) Sanitize()
type SegmentValue ¶ added in v0.1.7
func (*SegmentValue) HasValidIdentity ¶ added in v0.13.2
func (v *SegmentValue) HasValidIdentity() bool
func (*SegmentValue) Sanitize ¶ added in v0.13.2
func (v *SegmentValue) Sanitize()
type SqlDefinitionRow ¶
type SqlDefinitionRow struct {
Instance string `db:"instance" json:"instance" ch:"instance" bigquery:"instance"`
Database string `db:"database" json:"database" ch:"_database" bigquery:"database"`
Schema string `db:"schema" json:"schema" ch:"schema" bigquery:"schema"`
Table string `db:"table" json:"table" ch:"table" bigquery:"table"`
IsView bool `db:"is_view" json:"is_view" ch:"is_view" bigquery:"is_view"`
IsTable bool `db:"is_table" json:"is_table" ch:"is_table" bigquery:"is_table"`
IsMaterializedView bool `db:"is_materialized_view" json:"is_materialized_view" ch:"is_materialized_view" bigquery:"is_materialized_view"`
TableType string `db:"table_type" json:"table_type" ch:"table_type" bigquery:"table_type"`
Sql string `db:"sql" json:"sql" ch:"sql" bigquery:"sql"`
Description *string ` json:"description,omitempty"`
Tags []*Tag ` json:"tags,omitempty"`
}
func (*SqlDefinitionRow) HasValidIdentity ¶ added in v0.13.2
func (r *SqlDefinitionRow) HasValidIdentity() bool
func (*SqlDefinitionRow) Sanitize ¶ added in v0.13.2
func (r *SqlDefinitionRow) Sanitize()
func (SqlDefinitionRow) TableFqn ¶
func (r SqlDefinitionRow) TableFqn() DwhFqn
type StringValue ¶ added in v0.13.7
type StringValue string
StringValue preserves text values verbatim. Used by RunRawQuery so generic "run this query" surfaces see string columns as strings rather than having them collapsed to IgnoredValue (as QueryCustomMetrics does, which is correct for the metrics/profile agent path but wrong for raw data preview).
type TableChangeEvent ¶ added in v0.9.2
type TableChangeEvent struct {
// When the change was committed. Use for time-travel AS OF.
Timestamp time.Time
// Database-specific version identifier.
// Databricks: Delta version number. BigQuery: job_id. Snowflake: empty (hourly bucket).
Version string
// Type of operation: "INSERT", "UPDATE", "DELETE", "MERGE", "COPY", "TRUNCATE", "OTHER"
Operation string
// Row counts (nil if not available)
RowsInserted *int64
RowsUpdated *int64
RowsDeleted *int64
}
TableChangeEvent represents a single modification event on a table.
type TableChangeHistoryProvider ¶ added in v0.9.2
type TableChangeHistoryProvider interface {
FetchTableChangeHistory(
ctx context.Context,
fqn DwhFqn,
from, to time.Time,
limit int,
) ([]*TableChangeEvent, error)
}
TableChangeHistoryProvider returns recent modification events for a table, ordered by timestamp descending (most recent first).
Enables constructing time-travel queries:
AT(TIMESTAMP => event.Timestamp - 1s) -- Snowflake FOR SYSTEM_TIME AS OF event.Timestamp -- BigQuery TIMESTAMP AS OF event.Timestamp -- Databricks
type TableConstraintRow ¶ added in v0.9.0
type TableConstraintRow struct {
Instance string `db:"instance" json:"instance" ch:"instance" bigquery:"instance"`
Database string `db:"database" json:"database" ch:"_database" bigquery:"database"`
Schema string `db:"schema" json:"schema" ch:"schema" bigquery:"schema"`
Table string `db:"table" json:"table" ch:"table" bigquery:"table"`
ConstraintName string `db:"constraint_name" json:"constraint_name" ch:"constraint_name" bigquery:"constraint_name"`
ColumnName string `db:"column_name" json:"column_name" ch:"column_name" bigquery:"column_name"`
ConstraintType string `db:"constraint_type" json:"constraint_type" ch:"constraint_type" bigquery:"constraint_type"`
ColumnPosition int32 `db:"column_position" json:"column_position" ch:"column_position" bigquery:"column_position"`
ConstraintExpression string `db:"constraint_expression" json:"constraint_expression" ch:"constraint_expression" bigquery:"constraint_expression"`
IsEnforced *bool `db:"is_enforced" json:"is_enforced" ch:"is_enforced" bigquery:"is_enforced"`
}
TableConstraintRow represents a constraint or key on a table column. This covers traditional indexes, primary keys, unique constraints, as well as warehouse-specific concepts like BigQuery partitioning/clustering, ClickHouse sorting keys, and Snowflake clustering keys.
func (*TableConstraintRow) HasValidIdentity ¶ added in v0.13.2
func (r *TableConstraintRow) HasValidIdentity() bool
func (*TableConstraintRow) Sanitize ¶ added in v0.13.2
func (r *TableConstraintRow) Sanitize()
func (TableConstraintRow) TableFqn ¶ added in v0.9.0
func (r TableConstraintRow) TableFqn() DwhFqn
type TableMetricsRow ¶
type TableMetricsRow struct {
Instance string `db:"instance" json:"instance" ch:"instance" bigquery:"instance"`
Database string `db:"database" json:"database" ch:"_database" bigquery:"database"`
Schema string `db:"schema" json:"schema" ch:"schema" bigquery:"schema"`
Table string `db:"table" json:"table" ch:"table" bigquery:"table"`
RowCount *int64 `db:"row_count" json:"row_count" ch:"row_count" bigquery:"row_count"`
UpdatedAt *time.Time `db:"updated_at" json:"updated_at" ch:"updated_at" bigquery:"updated_at"`
SizeBytes *int64 `db:"size_bytes" json:"size_bytes" ch:"size_bytes" bigquery:"size_bytes"`
}
func (*TableMetricsRow) HasValidIdentity ¶ added in v0.13.2
func (r *TableMetricsRow) HasValidIdentity() bool
func (*TableMetricsRow) Sanitize ¶ added in v0.13.2
func (r *TableMetricsRow) Sanitize()
func (TableMetricsRow) TableFqn ¶
func (r TableMetricsRow) TableFqn() DwhFqn
type TableRow ¶
type TableRow struct {
Instance string `db:"instance" json:"instance" ch:"instance" bigquery:"instance"`
Database string `db:"database" json:"database" ch:"_database" bigquery:"database"`
Schema string `db:"schema" json:"schema" ch:"schema" bigquery:"schema"`
Table string `db:"table" json:"table" ch:"table" bigquery:"table"`
TableType string `db:"table_type" json:"table_type" ch:"table_type" bigquery:"table_type"`
Description *string `db:"description" json:"description" ch:"description" bigquery:"description"`
Tags []*Tag `db:"tags" json:"tags"`
IsView bool `db:"is_view" json:"is_view" ch:"is_view"`
IsTable bool `db:"is_table" json:"is_table" ch:"is_table"`
IsMaterializedView bool `db:"is_materialized_view" json:"is_materialized_view" ch:"is_materialized_view"`
Options map[string]interface{} `db:"options" json:"options"`
Annotations []*Annotation `db:"annotations" json:"annotations"`
// Constraints is optionally populated by QueryTables when WithConstraints() is passed.
// When non-nil, callers may skip a separate QueryTableConstraints call.
Constraints []*TableConstraintRow `json:"constraints,omitempty"`
}
func (*TableRow) HasValidIdentity ¶ added in v0.13.2
type Tag ¶
type Tag struct {
// Optionally prefix (`tag.` / `policytag.` / etc)
TagName string `json:"tag_name"`
TagValue string `json:"tag_value"`
}
func (*Tag) HasValidIdentity ¶ added in v0.13.2
type Unwrapper ¶ added in v0.13.3
type Unwrapper interface {
Unwrap() Scrapper
}
Unwrapper is implemented by Scrapper decorators (sanitize, reject, scope, ...) so callers can walk to an inner scrapper of a specific type. It mirrors the errors.Unwrap idiom: together with As it lets code type-assert past arbitrary decorator chains without each decorator having to know about every interface a consumer might care about.
type WithSetInstance ¶
type WithSetInstance interface {
SetInstance(instance string)
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package reject provides a Scrapper decorator that drops rows whose identity fields (the parts forming an object's fully-qualified name) contain NUL bytes or invalid UTF-8.
|
Package reject provides a Scrapper decorator that drops rows whose identity fields (the parts forming an object's fully-qualified name) contain NUL bytes or invalid UTF-8. |
|
Package sanitize provides a Scrapper decorator that strips NUL bytes and repairs invalid UTF-8 in every row returned by the underlying scrapper.
|
Package sanitize provides a Scrapper decorator that strips NUL bytes and repairs invalid UTF-8 in every row returned by the underlying scrapper. |
|
Package scrappertest provides a compliance test suite that can be embedded in warehouse-specific integration test suites to validate that a scrapper implementation conforms to the expected contract.
|
Package scrappertest provides a compliance test suite that can be embedded in warehouse-specific integration test suites to validate that a scrapper implementation conforms to the expected contract. |