Documentation
¶
Overview ¶
Package inline provides inline SQL model data and typed VALUES rows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClosureTypedRows ¶
func BuildClosureTypedRows(closureRows []analysis.ClosureRow) []sqldsl.ValuesRow
BuildClosureTypedRows builds typed ValuesRow slices for closure data. Returns nil for empty input (TypedValuesTable handles empty case).
func BuildUsersetTypedRows ¶
func BuildUsersetTypedRows(analyses []analysis.RelationAnalysis) []sqldsl.ValuesRow
BuildUsersetTypedRows builds typed ValuesRow slices for userset data. Returns nil for empty input (TypedValuesTable handles empty case).
Types ¶
type InlineSQLData ¶
type InlineSQLData struct {
// ClosureRows contains typed expression rows for closure data.
// Each row has 3 columns: object_type, relation, satisfying_relation.
ClosureRows []sqldsl.ValuesRow
// UsersetRows contains typed expression rows for userset data.
// Each row has 4 columns: object_type, relation, subject_type, subject_relation.
UsersetRows []sqldsl.ValuesRow
}
InlineSQLData contains SQL VALUES payloads that replace database-backed model tables. Rationale: Model data is inlined into SQL VALUES clauses rather than querying database tables. This eliminates the need for persistent melange_model tables and ensures generated functions are self-contained. When the schema changes, migration regenerates all functions with updated inline data. This approach trades function size for runtime simplicity and removes a JOIN from every check.
func BuildInlineSQLData ¶
func BuildInlineSQLData(closureRows []analysis.ClosureRow, analyses []analysis.RelationAnalysis) InlineSQLData
BuildInlineSQLData builds inline SQL data for tools and tests.