codegen

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package codegen generates the same CRUD source for the admin UI and CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(db *gorm.DB, o Options) (map[string][]byte, error)

Generate reads metadata and returns source files without writing them.

func Indexes

func Indexes(db *gorm.DB, table string) ([]gorm.Index, error)

Indexes includes unique constraints omitted by some GORM drivers.

func Tables

func Tables(db *gorm.DB) ([]string, error)

Tables lists business tables without filtering by a table-name prefix.

func Write

func Write(output string, files map[string][]byte) ([]string, error)

Write creates generated files under output without replacing existing source. A failed write removes only the files created by this call.

Types

type Options

type Options struct {
	Table, Resource, Directory, Mode, Module string
	Backend, Frontend                        string
	Migration                                bool
}

Options selects the source table and output layout, relative to the output root.

Jump to

Keyboard shortcuts

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