sql

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sql provides embedded SQL files for Melange infrastructure.

Index

Constants

This section is empty.

Variables

View Source
var ClosureSQL string

ClosureSQL contains the melange_relation_closure table definition and indexes. This table stores the precomputed transitive closure of implied-by relations, enabling efficient role hierarchy resolution without recursive function calls.

Applied via CREATE TABLE IF NOT EXISTS for idempotence.

View Source
var FunctionsSQL = strings.Join([]string{
	functionsUsersetHelpersSQL,
	functionsSubjectGrantsSQL,
	functionsExclusionsSQL,
	functionsPermissionsSQL,
	functionsQueriesSQL,
}, "\n\n")

FunctionsSQL concatenates all function SQL files for backwards compatibility.

View Source
var FunctionsSQLFiles = []SQLFile{
	{Path: "functions/01_userset_helpers.sql", Contents: functionsUsersetHelpersSQL},
	{Path: "functions/02_subject_grants.sql", Contents: functionsSubjectGrantsSQL},
	{Path: "functions/03_exclusions.sql", Contents: functionsExclusionsSQL},
	{Path: "functions/04_permissions.sql", Contents: functionsPermissionsSQL},
	{Path: "functions/05_queries.sql", Contents: functionsQueriesSQL},
}

FunctionsSQLFiles lists the function SQL files in application order.

View Source
var ModelSQL string

ModelSQL contains the melange_model table definition and indexes. Applied via CREATE TABLE IF NOT EXISTS for idempotence.

Functions

This section is empty.

Types

type SQLFile added in v0.2.0

type SQLFile struct {
	Path     string
	Contents string
}

SQLFile describes a named SQL payload for migration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL