Documentation
¶
Overview ¶
Package lysgen contains experimental functions to generate code from Postgres database tables.
Index ¶
- func Equal(ctx context.Context, db *pgxpool.Pool, schema, table string) (res string, err error)
- func GetGoDataTypeFromPg(pgType string) (goType, omitStr string, err error)
- func GetTsDataTypeFromPg(pgType string) (tsType string, err error)
- func InputModel(ctx context.Context, db *pgxpool.Pool, schema, table string, ...) (res string, err error)
- func TsTypes(ctx context.Context, db *pgxpool.Pool, schema, table string) (res string, err error)
- func View(ctx context.Context, db *pgxpool.Pool, schema, table string) (res string, err error)
- func WriteToClipboard(s string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶ added in v0.1.31
Equal generates the Go store Equal function from the supplied db table
func GetGoDataTypeFromPg ¶
GetGoDataTypeFromPg returns a Go data type from a PostgreSQL data type
func GetTsDataTypeFromPg ¶ added in v0.1.29
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 TsTypes ¶ added in v0.3.27
TsTypes generates the TS type definitions from the supplied db table only handles 1 level of join
func View ¶
View generates the db view from the supplied db table only handles 1 level of join, and does not coalesce nulls
func WriteToClipboard ¶
WriteToClipboard writes s to the clipboard. Only tested on WSL2 so far
Types ¶
This section is empty.