Documentation ¶
Index ¶
- type AsKeywordMeta
- type Column
- type ColumnType
- type SelectedColumns
- type TableConfig
- func (c *TableConfig) GetColumnType(tableName string, columnName string) (*ColumnType, error)
- func (c *TableConfig) GetMetadataForColumns(tableName string, columnNames []string) ([]*message.ColumnMetadata, error)
- func (c *TableConfig) GetMetadataForSelectedColumns(tableName string, columnNames []SelectedColumns, ...) ([]*message.ColumnMetadata, error)
- func (c *TableConfig) GetPkByTableName(tableName string) ([]Column, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsKeywordMeta ¶
type AsKeywordMeta struct { IsFunc bool Name string Alias string DataType datatype.DataType CQLType string }
Select Query Models
type ColumnType ¶
type SelectedColumns ¶
type TableConfig ¶
type TableConfig struct { Logger *zap.Logger TablesMetaData map[string]map[string]*Column PkMetadataCache map[string][]Column KeyspaceFlatter bool }
func (*TableConfig) GetColumnType ¶
func (c *TableConfig) GetColumnType(tableName string, columnName string) (*ColumnType, error)
GetColumnType retrieves the column types for a specified column in a specified table. This method is a part of the TableConfig struct and is used to map column types from Cassandra (CQL) to Google Cloud Spanner.
Parameters: - tableName: A string representing the name of the table. - columnName: A string representing the name of the column within the specified table.
Returns:
- A pointer to a ColumnType struct that contains both the CQL type and the corresponding Spanner type for the specified column.
- An error if the function is unable to determine the corresponding Spanner type.
func (*TableConfig) GetMetadataForColumns ¶
func (c *TableConfig) GetMetadataForColumns(tableName string, columnNames []string) ([]*message.ColumnMetadata, error)
GetMetadataForColumns retrieves metadata for specific columns in a given table. This method is a part of the TableConfig struct.
Parameters:
- tableName: The name of the table for which column metadata is being requested.
- columnNames(optional):Accepts nil if no columnNames provided or else A slice of strings containing the names of the columns for which metadata is required. If this slice is empty, metadata for all columns in the table will be returned.
Returns: - A slice of pointers to ColumnMetadata structs containing metadata for each requested column. - An error if the specified table is not found in the TablesMetaData.
func (*TableConfig) GetMetadataForSelectedColumns ¶
func (c *TableConfig) GetMetadataForSelectedColumns(tableName string, columnNames []SelectedColumns, aliasMap map[string]AsKeywordMeta) ([]*message.ColumnMetadata, error)
GetMetadataForSelectedColumns simply fetching column metadata for selected columns .
Parameters:
- tableName: The name of the table for which column metadata is being requested.
- columnNames(optional): []SelectedColumns - Accepts nil if no columnNames provided or else A slice of strings containing the names of the columns for which metadata is required. If this slice is empty, metadata for all columns in the table will be returned.
Returns: - A slice of pointers to ColumnMetadata structs containing metadata for each requested column. - An error if the specified table is not found in the TablesMetaData.
func (*TableConfig) GetPkByTableName ¶
func (c *TableConfig) GetPkByTableName(tableName string) ([]Column, error)
GetPkByTableName searches for and retrieves the primary keys of a specific table
Parameters:
- tableName: A string representing the name of the table for which the metadata is requested.
Returns:
- []Column: Array of Column details which are Primary Keys.
- An error: Returns error if function not able to search any primary keys