// // 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 Benefits = newBenefitsTable("payments", "benefits", "") type benefitsTable struct { postgres.Table // Columns AccountID postgres.ColumnString Origin postgres.ColumnString AdsPaidUntil postgres.ColumnTimestampz AdsForever postgres.ColumnBool Hints postgres.ColumnInteger UpdatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList DefaultColumns postgres.ColumnList } type BenefitsTable struct { benefitsTable EXCLUDED benefitsTable } // AS creates new BenefitsTable with assigned alias func (a BenefitsTable) AS(alias string) *BenefitsTable { return newBenefitsTable(a.SchemaName(), a.TableName(), alias) } // Schema creates new BenefitsTable with assigned schema name func (a BenefitsTable) FromSchema(schemaName string) *BenefitsTable { return newBenefitsTable(schemaName, a.TableName(), a.Alias()) } // WithPrefix creates new BenefitsTable with assigned table prefix func (a BenefitsTable) WithPrefix(prefix string) *BenefitsTable { return newBenefitsTable(a.SchemaName(), prefix+a.TableName(), a.TableName()) } // WithSuffix creates new BenefitsTable with assigned table suffix func (a BenefitsTable) WithSuffix(suffix string) *BenefitsTable { return newBenefitsTable(a.SchemaName(), a.TableName()+suffix, a.TableName()) } func newBenefitsTable(schemaName, tableName, alias string) *BenefitsTable { return &BenefitsTable{ benefitsTable: newBenefitsTableImpl(schemaName, tableName, alias), EXCLUDED: newBenefitsTableImpl("", "excluded", ""), } } func newBenefitsTableImpl(schemaName, tableName, alias string) benefitsTable { var ( AccountIDColumn = postgres.StringColumn("account_id") OriginColumn = postgres.StringColumn("origin") AdsPaidUntilColumn = postgres.TimestampzColumn("ads_paid_until") AdsForeverColumn = postgres.BoolColumn("ads_forever") HintsColumn = postgres.IntegerColumn("hints") UpdatedAtColumn = postgres.TimestampzColumn("updated_at") allColumns = postgres.ColumnList{AccountIDColumn, OriginColumn, AdsPaidUntilColumn, AdsForeverColumn, HintsColumn, UpdatedAtColumn} mutableColumns = postgres.ColumnList{AdsPaidUntilColumn, AdsForeverColumn, HintsColumn, UpdatedAtColumn} defaultColumns = postgres.ColumnList{AdsForeverColumn, HintsColumn, UpdatedAtColumn} ) return benefitsTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns AccountID: AccountIDColumn, Origin: OriginColumn, AdsPaidUntil: AdsPaidUntilColumn, AdsForever: AdsForeverColumn, Hints: HintsColumn, UpdatedAt: UpdatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, DefaultColumns: defaultColumns, } }