Documentation ¶
Index ¶
- Variables
- func GetColumnPostgreSQLType(table *schema.Table, column *schema.Column) (string, *schema.Diagnostics)
- type LockInformation
- type LockRefreshGoroutine
- type PostgresqlCRUDExecutor
- func (x *PostgresqlCRUDExecutor) Exec(ctx context.Context, query string, args ...any) *schema.Diagnostics
- func (x *PostgresqlCRUDExecutor) Insert(ctx context.Context, table *schema.Table, rows *schema.Rows) *schema.Diagnostics
- func (x *PostgresqlCRUDExecutor) Query(ctx context.Context, query string, args ...any) (storage.QueryResult, *schema.Diagnostics)
- func (x *PostgresqlCRUDExecutor) SetClientMeta(clientMeta *schema.ClientMeta)
- type PostgresqlKeyValueExecutor
- func (x *PostgresqlKeyValueExecutor) DeleteKey(ctx context.Context, key string) *schema.Diagnostics
- func (x *PostgresqlKeyValueExecutor) GetValue(ctx context.Context, key string) (string, *schema.Diagnostics)
- func (x *PostgresqlKeyValueExecutor) ListKey(ctx context.Context) (*schema.Rows, *schema.Diagnostics)
- func (x *PostgresqlKeyValueExecutor) SetKey(ctx context.Context, key, value string) *schema.Diagnostics
- type PostgresqlNamespaceAdmin
- func (x *PostgresqlNamespaceAdmin) NamespaceCreate(ctx context.Context, namespace string) *schema.Diagnostics
- func (x *PostgresqlNamespaceAdmin) NamespaceDrop(ctx context.Context, namespace string) *schema.Diagnostics
- func (x *PostgresqlNamespaceAdmin) NamespaceList(ctx context.Context) ([]string, *schema.Diagnostics)
- type PostgresqlQueryResult
- func (x *PostgresqlQueryResult) Close() *schema.Diagnostics
- func (x *PostgresqlQueryResult) Decode(item any) *schema.Diagnostics
- func (x *PostgresqlQueryResult) GetColumnNames() []string
- func (x *PostgresqlQueryResult) GetRawQueryResult() any
- func (x *PostgresqlQueryResult) Next() bool
- func (x *PostgresqlQueryResult) ReadRows(rowLimit int) (*schema.Rows, *schema.Diagnostics)
- func (x *PostgresqlQueryResult) Values() ([]any, *schema.Diagnostics)
- func (x *PostgresqlQueryResult) ValuesMap() (map[string]any, *schema.Diagnostics)
- type PostgresqlStorage
- func (x *PostgresqlStorage) Close() *schema.Diagnostics
- func (x *PostgresqlStorage) DebugF(msg string, args ...any)
- func (x *PostgresqlStorage) ErrorF(msg string, args ...any)
- func (x *PostgresqlStorage) GetStorageConnection() any
- func (x *PostgresqlStorage) GetTime(ctx context.Context) (time.Time, error)
- func (x *PostgresqlStorage) Lock(ctx context.Context, lockId, ownerId string) error
- func (x *PostgresqlStorage) NewColumnValueConvertor() schema.ColumnValueConvertor
- func (x *PostgresqlStorage) SetClientMeta(clientMeta *schema.ClientMeta)
- func (x *PostgresqlStorage) UnLock(ctx context.Context, lockId, ownerId string) error
- type PostgresqlStorageOptions
- type PostgresqlTableAdmin
- func (x *PostgresqlTableAdmin) TableCreate(ctx context.Context, table *schema.Table) *schema.Diagnostics
- func (x *PostgresqlTableAdmin) TableDrop(ctx context.Context, table *schema.Table) *schema.Diagnostics
- func (x *PostgresqlTableAdmin) TableList(ctx context.Context, namespace string) ([]*schema.Table, *schema.Diagnostics)
- func (x *PostgresqlTableAdmin) TablesCreate(ctx context.Context, tables []*schema.Table) *schema.Diagnostics
- func (x *PostgresqlTableAdmin) TablesDrop(ctx context.Context, tables []*schema.Table) *schema.Diagnostics
- type PostgresqlTransactionExecutor
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetColumnPostgreSQLType ¶ added in v0.0.20
func GetColumnPostgreSQLType(table *schema.Table, column *schema.Column) (string, *schema.Diagnostics)
Convert Responsible for converting standard column types to their Postgresql counterparts
Types ¶
type LockInformation ¶ added in v0.0.15
type LockInformation struct { // Who holds the lock OwnerId string // Reentrant lock LockCount int // The expected expiration time of this lock ExceptedExpireTime time.Time }
LockInformation Some information about locks
func FromJsonString ¶ added in v0.0.15
func FromJsonString(jsonString string) (*LockInformation, error)
func (*LockInformation) ToJsonString ¶ added in v0.0.15
func (x *LockInformation) ToJsonString() string
type LockRefreshGoroutine ¶ added in v0.0.15
type LockRefreshGoroutine struct {
// contains filtered or unexported fields
}
func NewLockRefreshGoroutine ¶ added in v0.0.15
func NewLockRefreshGoroutine(storage *PostgresqlStorage, lockId, ownerId string) *LockRefreshGoroutine
func (*LockRefreshGoroutine) Start ¶ added in v0.0.15
func (x *LockRefreshGoroutine) Start()
func (*LockRefreshGoroutine) Stop ¶ added in v0.0.15
func (x *LockRefreshGoroutine) Stop()
type PostgresqlCRUDExecutor ¶
type PostgresqlCRUDExecutor struct {
// contains filtered or unexported fields
}
func NewPostgresqlCRUDExecutor ¶
func NewPostgresqlCRUDExecutor(pool *pgxpool.Pool) *PostgresqlCRUDExecutor
func (*PostgresqlCRUDExecutor) Exec ¶
func (x *PostgresqlCRUDExecutor) Exec(ctx context.Context, query string, args ...any) *schema.Diagnostics
func (*PostgresqlCRUDExecutor) Insert ¶
func (x *PostgresqlCRUDExecutor) Insert(ctx context.Context, table *schema.Table, rows *schema.Rows) *schema.Diagnostics
func (*PostgresqlCRUDExecutor) Query ¶
func (x *PostgresqlCRUDExecutor) Query(ctx context.Context, query string, args ...any) (storage.QueryResult, *schema.Diagnostics)
func (*PostgresqlCRUDExecutor) SetClientMeta ¶
func (x *PostgresqlCRUDExecutor) SetClientMeta(clientMeta *schema.ClientMeta)
type PostgresqlKeyValueExecutor ¶ added in v0.0.13
type PostgresqlKeyValueExecutor struct {
// contains filtered or unexported fields
}
func NewPostgresqlKeyValueExecutor ¶ added in v0.0.13
func NewPostgresqlKeyValueExecutor(executor *PostgresqlCRUDExecutor) *PostgresqlKeyValueExecutor
func (*PostgresqlKeyValueExecutor) DeleteKey ¶ added in v0.0.13
func (x *PostgresqlKeyValueExecutor) DeleteKey(ctx context.Context, key string) *schema.Diagnostics
func (*PostgresqlKeyValueExecutor) GetValue ¶ added in v0.0.13
func (x *PostgresqlKeyValueExecutor) GetValue(ctx context.Context, key string) (string, *schema.Diagnostics)
func (*PostgresqlKeyValueExecutor) ListKey ¶ added in v0.0.13
func (x *PostgresqlKeyValueExecutor) ListKey(ctx context.Context) (*schema.Rows, *schema.Diagnostics)
func (*PostgresqlKeyValueExecutor) SetKey ¶ added in v0.0.13
func (x *PostgresqlKeyValueExecutor) SetKey(ctx context.Context, key, value string) *schema.Diagnostics
type PostgresqlNamespaceAdmin ¶
type PostgresqlNamespaceAdmin struct {
// contains filtered or unexported fields
}
func NewPostgresqlNamespaceAdmin ¶
func NewPostgresqlNamespaceAdmin(crudExecutor storage.CRUDExecutor) *PostgresqlNamespaceAdmin
func (*PostgresqlNamespaceAdmin) NamespaceCreate ¶
func (x *PostgresqlNamespaceAdmin) NamespaceCreate(ctx context.Context, namespace string) *schema.Diagnostics
func (*PostgresqlNamespaceAdmin) NamespaceDrop ¶
func (x *PostgresqlNamespaceAdmin) NamespaceDrop(ctx context.Context, namespace string) *schema.Diagnostics
func (*PostgresqlNamespaceAdmin) NamespaceList ¶
func (x *PostgresqlNamespaceAdmin) NamespaceList(ctx context.Context) ([]string, *schema.Diagnostics)
type PostgresqlQueryResult ¶
type PostgresqlQueryResult struct {
// contains filtered or unexported fields
}
func (*PostgresqlQueryResult) Close ¶
func (x *PostgresqlQueryResult) Close() *schema.Diagnostics
func (*PostgresqlQueryResult) Decode ¶
func (x *PostgresqlQueryResult) Decode(item any) *schema.Diagnostics
func (*PostgresqlQueryResult) GetColumnNames ¶
func (x *PostgresqlQueryResult) GetColumnNames() []string
func (*PostgresqlQueryResult) GetRawQueryResult ¶
func (x *PostgresqlQueryResult) GetRawQueryResult() any
func (*PostgresqlQueryResult) Next ¶
func (x *PostgresqlQueryResult) Next() bool
func (*PostgresqlQueryResult) ReadRows ¶
func (x *PostgresqlQueryResult) ReadRows(rowLimit int) (*schema.Rows, *schema.Diagnostics)
func (*PostgresqlQueryResult) Values ¶
func (x *PostgresqlQueryResult) Values() ([]any, *schema.Diagnostics)
func (*PostgresqlQueryResult) ValuesMap ¶
func (x *PostgresqlQueryResult) ValuesMap() (map[string]any, *schema.Diagnostics)
type PostgresqlStorage ¶
type PostgresqlStorage struct { *PostgresqlCRUDExecutor *PostgresqlTransactionExecutor *PostgresqlTableAdmin *PostgresqlNamespaceAdmin *PostgresqlKeyValueExecutor // contains filtered or unexported fields }
func NewPostgresqlStorage ¶
func NewPostgresqlStorage(ctx context.Context, options *PostgresqlStorageOptions) (*PostgresqlStorage, *schema.Diagnostics)
func (*PostgresqlStorage) Close ¶
func (x *PostgresqlStorage) Close() *schema.Diagnostics
func (*PostgresqlStorage) DebugF ¶ added in v0.0.17
func (x *PostgresqlStorage) DebugF(msg string, args ...any)
func (*PostgresqlStorage) ErrorF ¶ added in v0.0.17
func (x *PostgresqlStorage) ErrorF(msg string, args ...any)
func (*PostgresqlStorage) GetStorageConnection ¶
func (x *PostgresqlStorage) GetStorageConnection() any
GetStorageConnection Expose THE CONNECTIONS OF THE PG SO THAT THE UPPER LAYER CAN DIRECTLY MANIPULATE THE CONNECTIONS OF THE LOWER layer if they feel it is necessary
func (*PostgresqlStorage) Lock ¶ added in v0.0.15
func (x *PostgresqlStorage) Lock(ctx context.Context, lockId, ownerId string) error
func (*PostgresqlStorage) NewColumnValueConvertor ¶
func (x *PostgresqlStorage) NewColumnValueConvertor() schema.ColumnValueConvertor
func (*PostgresqlStorage) SetClientMeta ¶
func (x *PostgresqlStorage) SetClientMeta(clientMeta *schema.ClientMeta)
type PostgresqlStorageOptions ¶
func NewPostgresqlStorageOptions ¶
func NewPostgresqlStorageOptions(connectionString string) *PostgresqlStorageOptions
func (*PostgresqlStorageOptions) FromJsonString ¶
func (x *PostgresqlStorageOptions) FromJsonString(jsonString string) error
func (*PostgresqlStorageOptions) ToJsonString ¶
func (x *PostgresqlStorageOptions) ToJsonString() (string, error)
type PostgresqlTableAdmin ¶
type PostgresqlTableAdmin struct {
// contains filtered or unexported fields
}
func NewPostgresqlTableAdmin ¶
func NewPostgresqlTableAdmin(crudExecutor storage.CRUDExecutor) *PostgresqlTableAdmin
func (*PostgresqlTableAdmin) TableCreate ¶
func (x *PostgresqlTableAdmin) TableCreate(ctx context.Context, table *schema.Table) *schema.Diagnostics
func (*PostgresqlTableAdmin) TableDrop ¶
func (x *PostgresqlTableAdmin) TableDrop(ctx context.Context, table *schema.Table) *schema.Diagnostics
func (*PostgresqlTableAdmin) TableList ¶
func (x *PostgresqlTableAdmin) TableList(ctx context.Context, namespace string) ([]*schema.Table, *schema.Diagnostics)
TableList List all the tables under PG, here considering that the table may be very many, so the enumeration is concurrent
func (*PostgresqlTableAdmin) TablesCreate ¶
func (x *PostgresqlTableAdmin) TablesCreate(ctx context.Context, tables []*schema.Table) *schema.Diagnostics
func (*PostgresqlTableAdmin) TablesDrop ¶
func (x *PostgresqlTableAdmin) TablesDrop(ctx context.Context, tables []*schema.Table) *schema.Diagnostics
type PostgresqlTransactionExecutor ¶
type PostgresqlTransactionExecutor struct {
// contains filtered or unexported fields
}
func NewPostgresqlTransactionExecutor ¶
func NewPostgresqlTransactionExecutor(pool *pgxpool.Pool) *PostgresqlTransactionExecutor
func (*PostgresqlTransactionExecutor) Begin ¶
func (x *PostgresqlTransactionExecutor) Begin(ctx context.Context) (storage.TransactionExecutor, *schema.Diagnostics)
func (*PostgresqlTransactionExecutor) Commit ¶
func (x *PostgresqlTransactionExecutor) Commit(ctx context.Context) *schema.Diagnostics
func (*PostgresqlTransactionExecutor) Rollback ¶
func (x *PostgresqlTransactionExecutor) Rollback(ctx context.Context) *schema.Diagnostics
Source Files ¶
- postgresql_closeable.go
- postgresql_column_type_convertor.go
- postgresql_column_value_convertor_factory.go
- postgresql_crud_executor.go
- postgresql_key_value_executor.go
- postgresql_lock.go
- postgresql_namespace_admin.go
- postgresql_query_result.go
- postgresql_storage.go
- postgresql_storage_options.go
- postgresql_table_admin.go
- postgresql_transaction_executor.go
Click to show internal directories.
Click to hide internal directories.