postgres

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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