sql

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sql generates PostgreSQL DDL from the orm IR.

Output layout — one file per schema, mirroring the prisma fragment tree:

<db>/<schema>.postgres.sql

Each file carries CREATE SCHEMA, CREATE TYPE for every enum, CREATE TABLE with inline comments, FK constraints referencing the resolved PK column, and CREATE INDEX statements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct{}

Generator implements schema.Target for PostgreSQL DDL output.

func (*Generator) Generate

func (g *Generator) Generate(p *protogen.Plugin, dbs []*schema.Database) error

Generate writes one .postgres.sql file per schema plus a consolidated migrate.sql into the plugin response.

func (*Generator) Name

func (g *Generator) Name() string

Name returns the target identifier used in buf.gen.yaml opt: [target=sql].

Jump to

Keyboard shortcuts

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