Documentation ¶
Index ¶
- Constants
- func BuildCacheKey(tableName string) string
- func DefaultPostgreSQL(downloadWorkspace string, messageChannel *message.Channel[*schema.Diagnostics]) string
- func GetSchemaKey(providerName, providerVersion string, ...) string
- func GetStorageValue(ctx context.Context, storage *postgresql_storage.PostgresqlStorage, key string) (string, error)
- func SaveSchemaOwner(ctx context.Context, storage storage.Storage, owner *SchemaOwnerInformation) *schema.Diagnostics
- func SaveTableCacheInformation(ctx context.Context, storage storage.Storage, ...) *schema.Diagnostics
- func SetStorageValue(ctx context.Context, storage *postgresql_storage.PostgresqlStorage, ...) error
- type Option
- type SchemaOwnerInformation
- type TableCacheInformation
Constants ¶
View Source
const LockId = "selefra-fetch-lock"
View Source
const SchemaOwnerKey = "schema-owner-key"
Variables ¶
This section is empty.
Functions ¶
func BuildCacheKey ¶
func DefaultPostgreSQL ¶ added in v0.0.10
func DefaultPostgreSQL(downloadWorkspace string, messageChannel *message.Channel[*schema.Diagnostics]) string
DefaultPostgreSQL 1. If the default Postgresql is not installed, install it 2. If the default Postgresql is not started, start it 3. Return the default Postgresql DSN connection
func GetSchemaKey ¶
func GetSchemaKey(providerName, providerVersion string, providerConfigurationBlock *module.ProviderBlock) string
GetSchemaKey return provider schema named <required.name>_<required_version>_<provider_name>
func GetStorageValue ¶
func GetStorageValue(ctx context.Context, storage *postgresql_storage.PostgresqlStorage, key string) (string, error)
func SaveSchemaOwner ¶
func SaveSchemaOwner(ctx context.Context, storage storage.Storage, owner *SchemaOwnerInformation) *schema.Diagnostics
func SaveTableCacheInformation ¶
func SaveTableCacheInformation(ctx context.Context, storage storage.Storage, information *TableCacheInformation) *schema.Diagnostics
SaveTableCacheInformation Save the table cache information to the kv database
func SetStorageValue ¶
func SetStorageValue(ctx context.Context, storage *postgresql_storage.PostgresqlStorage, key, value string) error
Types ¶
type Option ¶
type Option func(pgopts *postgresql_storage.PostgresqlStorageOptions)
func WithSearchPath ¶
type SchemaOwnerInformation ¶
type SchemaOwnerInformation struct { // The host name of the holder Hostname string `json:"hostname"` // Holder's ID HolderID string `json:"holder_id"` // The name of the holder's configuration file ConfigurationName string `json:"configuration_name"` // MD5 configured when pulling data from this schema ConfigurationMD5 string `json:"configuration_md5"` }
SchemaOwnerInformation schema is held by whom, information about the holder
func GetSchemaOwner ¶
func GetSchemaOwner(ctx context.Context, storage storage.Storage) (*SchemaOwnerInformation, *schema.Diagnostics)
type TableCacheInformation ¶
type TableCacheInformation struct { // Table name TableName string `json:"table_name"` // The last time this table was pulled LastPullTime time.Time `json:"last_pull_time"` // Which batch was pulled off LastPullId string `json:"last_pull_id"` }
TableCacheInformation Some information about the table level cache
func ReadTableCacheInformation ¶
func ReadTableCacheInformation(ctx context.Context, storage storage.Storage, tableName string) (*TableCacheInformation, *schema.Diagnostics)
ReadTableCacheInformation Reads the table cache information from the database
Click to show internal directories.
Click to hide internal directories.