Ripped out literally everything to simplify the backend as much as possible. Some of the code was so horrifically complicated it's insaneeee
91 lines
2.6 KiB
Go
91 lines
2.6 KiB
Go
//
|
|
// Code generated by go-jet DO NOT EDIT.
|
|
//
|
|
// WARNING: Changes to this file may cause incorrect behavior
|
|
// and will be lost if the code is regenerated
|
|
//
|
|
|
|
package table
|
|
|
|
import (
|
|
"github.com/go-jet/jet/v2/postgres"
|
|
)
|
|
|
|
var Stacks = newStacksTable("haystack", "stacks", "")
|
|
|
|
type stacksTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
ID postgres.ColumnString
|
|
UserID postgres.ColumnString
|
|
Status postgres.ColumnString
|
|
Name postgres.ColumnString
|
|
Description postgres.ColumnString
|
|
CreatedAt postgres.ColumnTimestampz
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
}
|
|
|
|
type StacksTable struct {
|
|
stacksTable
|
|
|
|
EXCLUDED stacksTable
|
|
}
|
|
|
|
// AS creates new StacksTable with assigned alias
|
|
func (a StacksTable) AS(alias string) *StacksTable {
|
|
return newStacksTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new StacksTable with assigned schema name
|
|
func (a StacksTable) FromSchema(schemaName string) *StacksTable {
|
|
return newStacksTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new StacksTable with assigned table prefix
|
|
func (a StacksTable) WithPrefix(prefix string) *StacksTable {
|
|
return newStacksTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new StacksTable with assigned table suffix
|
|
func (a StacksTable) WithSuffix(suffix string) *StacksTable {
|
|
return newStacksTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newStacksTable(schemaName, tableName, alias string) *StacksTable {
|
|
return &StacksTable{
|
|
stacksTable: newStacksTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newStacksTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newStacksTableImpl(schemaName, tableName, alias string) stacksTable {
|
|
var (
|
|
IDColumn = postgres.StringColumn("id")
|
|
UserIDColumn = postgres.StringColumn("user_id")
|
|
StatusColumn = postgres.StringColumn("status")
|
|
NameColumn = postgres.StringColumn("name")
|
|
DescriptionColumn = postgres.StringColumn("description")
|
|
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
|
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, StatusColumn, NameColumn, DescriptionColumn, CreatedAtColumn}
|
|
mutableColumns = postgres.ColumnList{UserIDColumn, StatusColumn, NameColumn, DescriptionColumn, CreatedAtColumn}
|
|
)
|
|
|
|
return stacksTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
UserID: UserIDColumn,
|
|
Status: StatusColumn,
|
|
Name: NameColumn,
|
|
Description: DescriptionColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
}
|
|
}
|