bigtableclient

package
v0.0.0-...-1be548a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProfileId = "default"
)

Variables

This section is empty.

Functions

func BuildBigtableParams

func BuildBigtableParams(b *types.ExecutableSelectQuery) (map[string]any, error)

func BuildParamTypes

func BuildParamTypes(b *types.PreparedSelectQuery) map[string]bigtable.SQLType

func GenerateAppliedRowsResult

func GenerateAppliedRowsResult(keyspace types.Keyspace, table types.TableName, applied bool) *message.RowsResult

GenerateAppliedRowsResult creates a RowsResult message to indicate whether a database operation was applied. It generates a single column row result with a boolean indicating the application status. it is specifically for if exists and if not exists queries

Parameters:

  • keyspace: A string representing the name of the keyspace in which the table resides.
  • tableName: A string representing the name of the table where the operation was attempted.
  • applied: A boolean flag indicating whether the operation was successfully applied.

Returns: A pointer to a RowsResult object that contains metadata for a single boolean column denoting

the application status ([applied]) and the corresponding row data indicating true or false.

func GetProfileId

func GetProfileId(profileId string) string

GetProfileId returns the provided profile ID if it is not empty. If the provided profile ID is empty, it returns a default profile ID.

Types

type BigtableAdapter

type BigtableAdapter struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func NewBigtableClient

func NewBigtableClient(clients *types.BigtableClientManager, logger *zap.Logger, config *types.BigtableConfig, schemaManager *metadata.MetadataStore) *BigtableAdapter

func (*BigtableAdapter) ApplyBulkMutation

func (btc *BigtableAdapter) ApplyBulkMutation(ctx context.Context, keyspace types.Keyspace, tableName types.TableName, mutationData []types.IBigtableMutation) (BulkOperationResponse, error)

ApplyBulkMutation - Applies bulk mutations to the specified bigtable table.

Parameters:

  • ctx: Context for the operation, used for cancellation and deadlines.
  • tableName: Columns of the table to apply bulk mutations to.
  • mutationData: Slice of MutationData objects containing mutation details.

Returns:

  • BulkOperationResponse: Response indicating the result of the bulk operation.
  • error: Error if the bulk mutation fails.

func (*BigtableAdapter) DeleteRow

func (btc *BigtableAdapter) DeleteRow(ctx context.Context, deleteQueryData *types.BoundDeleteQuery) (*message.RowsResult, error)

func (*BigtableAdapter) DropAllRows

func (btc *BigtableAdapter) DropAllRows(ctx context.Context, data *types.TruncateTableStatementMap) error

func (*BigtableAdapter) Execute

func (*BigtableAdapter) ExecutePreparedStatement

func (btc *BigtableAdapter) ExecutePreparedStatement(ctx context.Context, query *types.ExecutableSelectQuery) (*message.RowsResult, error)

ExecutePreparedStatement - Executes a prepared statement on Bigtable and returns the result. Parameters:

  • ctx: Context for the operation, used for cancellation and deadlines.
  • query: rh.QueryMetadata containing the query and parameters.
  • preparedStmt: PreparedStatement object containing the prepared statement.

Returns:

  • *message.RowsResult: The result of the select statement.
  • time.Duration: The total elapsed time for the operation.
  • error: Error if the statement preparation or execution fails.

func (*BigtableAdapter) InsertRow

InsertRow - Inserts a row into the specified bigtable table.

Parameters:

  • ctx: Context for the operation, used for cancellation and deadlines.
  • data: PreparedInsertQuery object containing the table, row key, columns, values, and deleteColumnFamilies.

Returns:

  • error: Error if the insertion fails.

func (*BigtableAdapter) PrepareStatement

func (btc *BigtableAdapter) PrepareStatement(ctx context.Context, query types.IPreparedQuery) (*bigtable.PreparedStatement, error)

PrepareStatement prepares a query for execution using the bigtable SQL client.

func (*BigtableAdapter) UpdateRow

UpdateRow - Updates a row in the specified bigtable table.

Parameters:

  • ctx: Context for the operation, used for cancellation and deadlines.
  • data: PreparedUpdateQuery object containing the table, row key, columns, values, and DeleteColumnFamilies.

Returns:

  • error: Error if the update fails.

type BigtableBulkMutation

type BigtableBulkMutation struct {
	// contains filtered or unexported fields
}

func NewBigtableBulkMutation

func NewBigtableBulkMutation() *BigtableBulkMutation

func (*BigtableBulkMutation) AddMutation

func (b *BigtableBulkMutation) AddMutation(mut types.IBigtableMutation)

func (*BigtableBulkMutation) Mutations

type BulkOperationResponse

type BulkOperationResponse struct {
	FailedRows string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL