Documentation
¶
Index ¶
- func AnalyzeSecurityFields(schema bigquery.Schema) []securityField
- func BuildSchemaFieldMap(schema bigquery.Schema, prefix string) map[string]*bigquery.FieldSchema
- type Action
- func (x *Action) Configure(ctx context.Context) error
- func (x *Action) Flags() []cli.Flag
- func (x *Action) Helper() *cli.Command
- func (x *Action) LogValue() slog.Value
- func (x *Action) Name() string
- func (x *Action) Prompt(ctx context.Context) (string, error)
- func (x *Action) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)
- func (x *Action) Specs(ctx context.Context) ([]gollem.ToolSpec, error)
- type BigQueryClient
- type BigQueryClientFactory
- type BigQueryDataset
- type BigQueryJob
- type BigQueryQuery
- type BigQueryRowIterator
- type BigQueryTable
- type BulkConfig
- type BulkConfigEntry
- type ColumnConfig
- type Config
- type DefaultBigQueryClient
- type DefaultBigQueryClientFactory
- type DefaultBigQueryDataset
- type DefaultBigQueryJob
- func (j *DefaultBigQueryJob) ID() string
- func (j *DefaultBigQueryJob) LastStatus() *bigquery.JobStatus
- func (j *DefaultBigQueryJob) Location() string
- func (j *DefaultBigQueryJob) Read(ctx context.Context) (BigQueryRowIterator, error)
- func (j *DefaultBigQueryJob) Wait(ctx context.Context) (*bigquery.JobStatus, error)
- type DefaultBigQueryQuery
- type DefaultBigQueryRowIterator
- type DefaultBigQueryTable
- type PartitioningConfig
- type RunbookLoader
- type SchemaValidationIssue
- type SchemaValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeSecurityFields ¶ added in v0.1.0
AnalyzeSecurityFields analyzes BigQuery schema fields and categorizes them by security relevance
func BuildSchemaFieldMap ¶
BuildSchemaFieldMap creates a flat map of all fields (including nested) from BigQuery schema
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
func (*Action) Prompt ¶
Prompt returns additional instructions for the system prompt It provides information about available BigQuery tables and their descriptions
type BigQueryClient ¶
type BigQueryClient interface { Query(query string) BigQueryQuery Dataset(datasetID string) BigQueryDataset Close() error }
BigQueryClient is an interface for BigQuery client
type BigQueryClientFactory ¶
type BigQueryClientFactory interface {
NewClient(ctx context.Context, projectID string, opts ...option.ClientOption) (BigQueryClient, error)
}
BigQueryClientFactory is an interface for creating BigQuery clients
type BigQueryDataset ¶
type BigQueryDataset interface {
Table(tableID string) BigQueryTable
}
BigQueryDataset is an interface for BigQuery dataset
type BigQueryJob ¶
type BigQueryJob interface { Wait(ctx context.Context) (*bigquery.JobStatus, error) Read(ctx context.Context) (BigQueryRowIterator, error) LastStatus() *bigquery.JobStatus ID() string Location() string }
BigQueryJob is an interface for BigQuery job
type BigQueryQuery ¶
type BigQueryQuery interface { Run(ctx context.Context) (BigQueryJob, error) SetDryRun(dryRun bool) }
BigQueryQuery is an interface for BigQuery query
type BigQueryRowIterator ¶
BigQueryRowIterator is an interface for BigQuery row iterator
type BigQueryTable ¶
type BigQueryTable interface {
Metadata(ctx context.Context) (*bigquery.TableMetadata, error)
}
BigQueryTable is an interface for BigQuery table
type BulkConfig ¶
type BulkConfig struct {
Tables []BulkConfigEntry `yaml:"tables" json:"tables"`
}
BulkConfig represents the configuration file format for bulk processing
type BulkConfigEntry ¶
type BulkConfigEntry struct { TableID string `yaml:"table_id" json:"table_id"` Description string `yaml:"description" json:"description"` }
BulkConfigEntry represents a single table configuration for bulk processing
type ColumnConfig ¶
type ColumnConfig struct { Name string `yaml:"name" json:"name"` Description string `yaml:"description" json:"description"` ValueExample string `yaml:"value_example" json:"value_example"` Type string `yaml:"type" json:"type"` // STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP, DATE, TIME, DATETIME, BYTES, RECORD Fields []ColumnConfig `yaml:"fields" json:"fields"` // for RECORD type }
type Config ¶
type Config struct { // ProjectID // DatasetID DatasetID string `yaml:"dataset_id" json:"dataset_id"` // TableID TableID string `yaml:"table_id" json:"table_id"` // Description of the table Description string `yaml:"description" json:"description"` // Columns of the table. It's not required to describe all column. Columns []ColumnConfig `yaml:"columns" json:"columns"` // Partitioning Partitioning PartitioningConfig `yaml:"partitioning" json:"partitioning"` // Runbook paths - list of SQL files or directories RunbookPaths []string `yaml:"runbook_paths" json:"runbook_paths"` }
type DefaultBigQueryClient ¶
type DefaultBigQueryClient struct {
// contains filtered or unexported fields
}
DefaultBigQueryClient is the default implementation of BigQueryClient
func (*DefaultBigQueryClient) Close ¶
func (c *DefaultBigQueryClient) Close() error
func (*DefaultBigQueryClient) Dataset ¶
func (c *DefaultBigQueryClient) Dataset(datasetID string) BigQueryDataset
func (*DefaultBigQueryClient) Query ¶
func (c *DefaultBigQueryClient) Query(query string) BigQueryQuery
type DefaultBigQueryClientFactory ¶
type DefaultBigQueryClientFactory struct{}
DefaultBigQueryClientFactory is the default implementation of BigQueryClientFactory
func (*DefaultBigQueryClientFactory) NewClient ¶
func (f *DefaultBigQueryClientFactory) NewClient(ctx context.Context, projectID string, opts ...option.ClientOption) (BigQueryClient, error)
type DefaultBigQueryDataset ¶
type DefaultBigQueryDataset struct {
// contains filtered or unexported fields
}
DefaultBigQueryDataset is the default implementation of BigQueryDataset
func (*DefaultBigQueryDataset) Table ¶
func (d *DefaultBigQueryDataset) Table(tableID string) BigQueryTable
type DefaultBigQueryJob ¶
type DefaultBigQueryJob struct {
// contains filtered or unexported fields
}
DefaultBigQueryJob is the default implementation of BigQueryJob
func (*DefaultBigQueryJob) ID ¶
func (j *DefaultBigQueryJob) ID() string
func (*DefaultBigQueryJob) LastStatus ¶
func (j *DefaultBigQueryJob) LastStatus() *bigquery.JobStatus
func (*DefaultBigQueryJob) Location ¶
func (j *DefaultBigQueryJob) Location() string
func (*DefaultBigQueryJob) Read ¶
func (j *DefaultBigQueryJob) Read(ctx context.Context) (BigQueryRowIterator, error)
type DefaultBigQueryQuery ¶
type DefaultBigQueryQuery struct {
// contains filtered or unexported fields
}
DefaultBigQueryQuery is the default implementation of BigQueryQuery
func (*DefaultBigQueryQuery) Run ¶
func (q *DefaultBigQueryQuery) Run(ctx context.Context) (BigQueryJob, error)
func (*DefaultBigQueryQuery) SetDryRun ¶
func (q *DefaultBigQueryQuery) SetDryRun(dryRun bool)
type DefaultBigQueryRowIterator ¶
type DefaultBigQueryRowIterator struct {
// contains filtered or unexported fields
}
DefaultBigQueryRowIterator is the default implementation of BigQueryRowIterator
func (*DefaultBigQueryRowIterator) Next ¶
func (r *DefaultBigQueryRowIterator) Next(dst interface{}) error
func (*DefaultBigQueryRowIterator) Schema ¶
func (r *DefaultBigQueryRowIterator) Schema() bigquery.Schema
type DefaultBigQueryTable ¶
type DefaultBigQueryTable struct {
// contains filtered or unexported fields
}
DefaultBigQueryTable is the default implementation of BigQueryTable
func (*DefaultBigQueryTable) Metadata ¶
func (t *DefaultBigQueryTable) Metadata(ctx context.Context) (*bigquery.TableMetadata, error)
type PartitioningConfig ¶
type RunbookLoader ¶
type RunbookLoader struct {
// contains filtered or unexported fields
}
RunbookLoader loads SQL runbook files and processes them
func NewRunbookLoader ¶
func NewRunbookLoader(paths []string) *RunbookLoader
NewRunbookLoader creates a new RunbookLoader
func (*RunbookLoader) LoadRunbooks ¶
func (r *RunbookLoader) LoadRunbooks(ctx context.Context) (bigquery.RunbookEntries, error)
LoadRunbooks loads all SQL files from configured paths and returns RunbookEntries
type SchemaValidationIssue ¶
type SchemaValidationResult ¶
type SchemaValidationResult struct { Valid bool Issues []SchemaValidationIssue }
SchemaValidationResult holds the result of schema validation
func ValidateConfigAgainstSchema ¶
func ValidateConfigAgainstSchema(config *Config, tableMetadata *bigquery.TableMetadata) SchemaValidationResult
ValidateConfigAgainstSchema validates the generated config against the actual BigQuery table schema