Documentation
¶
Overview ¶
Package pg provides PostgreSQL type provider for CEL type system integration.
Index ¶
Constants ¶
const ( // MaxConnectionStringLength limits connection string length to prevent // resource exhaustion and align with ODBC standard (1024 chars). // Legitimate PostgreSQL connection strings rarely exceed a few hundred characters. MaxConnectionStringLength = 1000 )
Variables ¶
var ( // ErrInvalidSchema indicates a problem with the provided schema ErrInvalidSchema = errors.New("invalid schema") )
Sentinel errors specific to the pg package
var NewSchema = schema.NewSchema
NewSchema creates a new Schema. This is an alias for schema.NewSchema. New code should prefer schema.NewSchema directly.
Functions ¶
This section is empty.
Types ¶
type FieldSchema ¶
type FieldSchema = schema.FieldSchema
FieldSchema is an alias for schema.FieldSchema for backward compatibility. New code should prefer schema.FieldSchema directly.
type Schema ¶
Schema is an alias for schema.Schema for backward compatibility. New code should prefer schema.Schema directly.
type TypeProvider ¶
type TypeProvider interface {
types.Provider
LoadTableSchema(ctx context.Context, tableName string) error
GetSchemas() map[string]Schema
Close()
}
TypeProvider interface for PostgreSQL type providers
func NewTypeProvider ¶
func NewTypeProvider(schemas map[string]Schema) TypeProvider
NewTypeProvider creates a new PostgreSQL type provider with pre-defined schemas
func NewTypeProviderWithConnection ¶
func NewTypeProviderWithConnection(ctx context.Context, connectionString string) (TypeProvider, error)
NewTypeProviderWithConnection creates a new PostgreSQL type provider that can introspect database schemas