Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v1.4.14 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExtensions = []string{"uuid-ossp", "pgcrypto"}

DefaultExtensions are always installed regardless of POSTGRES_EXTENSIONS config.

Functions

func EnsureNpPluginsTable added in v1.0.13

func EnsureNpPluginsTable() string

EnsureNpPluginsTable returns the SQL statement that idempotently creates the np_plugins table. Callers (e.g. the live DB bootstrap path) can execute this directly against a running Postgres container when the postgres/init/ dir is not available (e.g. in upgrade scenarios).

The statement uses CREATE TABLE IF NOT EXISTS so it is always safe to execute more than once.

func GenerateInitScript

func GenerateInitScript(workdir string) error

GenerateInitScript creates the basic Postgres initialization SQL script containing the structural schemas required by Nhost containers, and also writes the np_plugins bootstrap script so that the table is created idempotently on every stack start.

func InstallExtensions

func InstallExtensions(ctx context.Context, dsn string, extras []string) error

InstallExtensions runs CREATE EXTENSION IF NOT EXISTS for DefaultExtensions plus any extras provided. Called from nself start Phase 2 (DB init). Safe to call multiple times — IF NOT EXISTS is idempotent.

func RenderInitScript added in v1.4.13

func RenderInitScript(_ string) (map[string][]byte, error)

RenderInitScript returns the Postgres init files GenerateInitScript writes, keyed by path relative to the project root, without touching the disk. Plan mode (internal/build, P7-LIVE-21) writes them through its Sink; both modes therefore render the same bytes. workdir only anchors future callers root, accepted for symmetry with GenerateInitScript and not read.

Types

This section is empty.

Directories

Path Synopsis
Package tablehash computes a per-table row count and an order-independent content hash, the single definition of "zero mismatch" shared by the importer, the exporter, the round trip and the image switch (EPIC D8, contract:cli.portable-export v1, P7-ADOPT-23).
Package tablehash computes a per-table row count and an order-independent content hash, the single definition of "zero mismatch" shared by the importer, the exporter, the round trip and the image switch (EPIC D8, contract:cli.portable-export v1, P7-ADOPT-23).

Jump to

Keyboard shortcuts

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