lysgen

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 7 Imported by: 0

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 GetTsDataTypeFromPg added in v0.1.29

func GetTsDataTypeFromPg(pgType string) (tsType string, err error)

GetTsDataTypeFromPg returns a Typescript data type from a PostgreSQL data type

func InputModel

func InputModel(ctx context.Context, db *pgxpool.Pool, schema, table string, withValidation bool) (res 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 TsDefinition added in v0.1.29

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

TsDefinition generates the TS type definition from the supplied db table only handles 1 level of join

func View

func View(ctx context.Context, db *pgxpool.Pool, schema, table string) (res 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