Documentation
¶
Overview ¶
Package supabase provides an ExecutionBackend implementation for Supabase (Postgres-compatible) with native pgxpool, pooler-mode awareness, RLS context injection, and internal schema filtering.
Index ¶
- func WithJWT(ctx context.Context, claims map[string]interface{}) context.Context
- type Backend
- func (b *Backend) Capabilities() *fabric.Capabilities
- func (b *Backend) Close() error
- func (b *Backend) ExecuteCustomOperation(ctx context.Context, op string, params map[string]interface{}) (interface{}, error)
- func (b *Backend) ExecuteQuery(ctx context.Context, query string) (*fabric.QueryResult, error)
- func (b *Backend) GetMetadata(ctx context.Context, resource string) (map[string]interface{}, error)
- func (b *Backend) GetSchema(ctx context.Context, resource string) (*fabric.Schema, error)
- func (b *Backend) ListResources(ctx context.Context, filters map[string]string) ([]fabric.Resource, error)
- func (b *Backend) Name() string
- func (b *Backend) Ping(ctx context.Context) error
- func (b *Backend) Pool() *pgxpool.Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements fabric.ExecutionBackend for Supabase projects.
func NewBackend ¶
func NewBackend(ctx context.Context, name string, config *loomv1.SupabaseConnection, logger *zap.Logger) (*Backend, error)
NewBackend creates a new Supabase backend from configuration.
func (*Backend) Capabilities ¶
func (b *Backend) Capabilities() *fabric.Capabilities
Capabilities returns the backend's capabilities.
func (*Backend) ExecuteCustomOperation ¶
func (b *Backend) ExecuteCustomOperation(ctx context.Context, op string, params map[string]interface{}) (interface{}, error)
ExecuteCustomOperation handles Supabase-specific operations.
func (*Backend) ExecuteQuery ¶
ExecuteQuery executes a SQL query against the Supabase database. If RLS is enabled and JWT claims are present in the context, the query is wrapped in an RLS-scoped transaction.
func (*Backend) GetMetadata ¶
GetMetadata retrieves metadata for a resource.
func (*Backend) ListResources ¶
func (b *Backend) ListResources(ctx context.Context, filters map[string]string) ([]fabric.Resource, error)
ListResources lists user-visible tables, excluding Supabase internal schemas.