lysgen

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 7 Imported by: 1

README

lysgen

Experimental functions to generate code from Postgres database tables.

Documentation

Overview

Package lysgen contains experimental functions to generate code from Postgres database tables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGoDataTypeFromPg

func GetGoDataTypeFromPg(pgType string) (goType string, err error)

GetGoDataTypeFromPg returns a Go data type from a PostgreSQL data type

func InputModel

func InputModel(ctx context.Context, db *pgxpool.Pool, schema, table string) (res string, stmt string, err error)

InputModel generates the store Input and Model structs from the supplied db table only handles 1 level of join, and does not coalesce nulls

func View

func View(ctx context.Context, db *pgxpool.Pool, schema, table string) (res string, stmt string, err error)

View generates the db view from the supplied db table only handles 1 level of join, and does not coalesce nulls

func WriteToClipboard

func WriteToClipboard(s string) error

currently only tested on WSL2

Types

This section is empty.

Jump to

Keyboard shortcuts

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