internal/infra/pg/schema.go
internal/infra/pg · 46 lines · 5 declarations · source
This file carries the package documentation, rendered on the package page.
Declarations
type Schema
type Schema string
Schema is a validated SQL identifier. Validation prevents identifier injection and accidental truncation; it is not an authorization boundary. A role granted multiple schemas can read them. Project predicates enforce the authorized scope set inside the instance memory namespace.
const maxIdentifierLength
const maxIdentifierLength = 63
PostgreSQL's NAMEDATALEN - 1. A longer name is silently truncated and can select the wrong namespace.
func NewSchema
func NewSchema(name string) (Schema, error)
NewSchema validates a database namespace.
method Schema.String
func (s Schema) String() string
method Schema.SQL
func (s Schema) SQL(template string) string
SQL renders a statement template for this namespace.