82 lines
2.1 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 Tools = newToolsTable("agents", "tools", "")
type toolsTable struct {
postgres.Table
// Columns
ID postgres.ColumnString
Tool postgres.ColumnString
AgentID postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
type ToolsTable struct {
toolsTable
EXCLUDED toolsTable
}
// AS creates new ToolsTable with assigned alias
func (a ToolsTable) AS(alias string) *ToolsTable {
return newToolsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new ToolsTable with assigned schema name
func (a ToolsTable) FromSchema(schemaName string) *ToolsTable {
return newToolsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new ToolsTable with assigned table prefix
func (a ToolsTable) WithPrefix(prefix string) *ToolsTable {
return newToolsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new ToolsTable with assigned table suffix
func (a ToolsTable) WithSuffix(suffix string) *ToolsTable {
return newToolsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newToolsTable(schemaName, tableName, alias string) *ToolsTable {
return &ToolsTable{
toolsTable: newToolsTableImpl(schemaName, tableName, alias),
EXCLUDED: newToolsTableImpl("", "excluded", ""),
}
}
func newToolsTableImpl(schemaName, tableName, alias string) toolsTable {
var (
IDColumn = postgres.StringColumn("id")
ToolColumn = postgres.StringColumn("tool")
AgentIDColumn = postgres.StringColumn("agent_id")
allColumns = postgres.ColumnList{IDColumn, ToolColumn, AgentIDColumn}
mutableColumns = postgres.ColumnList{ToolColumn, AgentIDColumn}
)
return toolsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ID: IDColumn,
Tool: ToolColumn,
AgentID: AgentIDColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}