nidus-sync/db/gen/nidus-sync/fileupload/table/pool.go
Eli Ribble 393836a86a
Fix notification of job happening before transaction is closed
This is kind of a wild one. Turns out that the triggers I was using
actually fire before the transaction is closed and I was primarily
getting lucky that the job was present on the other side of the
connection rather than having things built correctly.

I've fixed this by removing the trigger entirely and instead manually
triggering as part of the transaction. This makes the NOTIFY call happen
as soon as the transaction closes, just at the cost of making my
application be in charge of ensuring the NOTIFY gets called. Seems like
a win.

Part of doing this is porting the existing job creation code over to use
Jet. It's something I want to do anyway, so it's a win all around.
2026-05-22 23:34:38 +00:00

147 lines
6.5 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/Gleipnir-Technology/jet/postgres"
)
var Pool = newPoolTable("fileupload", "pool", "")
type poolTable struct {
postgres.Table
// Columns
AddressPostalCode postgres.ColumnString
AddressStreet postgres.ColumnString
Committed postgres.ColumnBool
Created postgres.ColumnTimestamp
CreatorID postgres.ColumnInteger
CsvFile postgres.ColumnInteger
Deleted postgres.ColumnTimestamp
Geom postgres.ColumnGeometry
H3cell postgres.ColumnString
ID postgres.ColumnInteger
IsInDistrict postgres.ColumnBool
IsNew postgres.ColumnBool
Notes postgres.ColumnString
PropertyOwnerName postgres.ColumnString
PropertyOwnerPhoneE164 postgres.ColumnString
ResidentOwned postgres.ColumnBool
ResidentPhoneE164 postgres.ColumnString
LineNumber postgres.ColumnInteger
Tags postgres.ColumnString
AddressNumber postgres.ColumnString
AddressLocality postgres.ColumnString
AddressRegion postgres.ColumnString
Condition postgres.ColumnString
AddressID postgres.ColumnInteger
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type PoolTable struct {
poolTable
EXCLUDED poolTable
}
// AS creates new PoolTable with assigned alias
func (a PoolTable) AS(alias string) *PoolTable {
return newPoolTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new PoolTable with assigned schema name
func (a PoolTable) FromSchema(schemaName string) *PoolTable {
return newPoolTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new PoolTable with assigned table prefix
func (a PoolTable) WithPrefix(prefix string) *PoolTable {
return newPoolTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new PoolTable with assigned table suffix
func (a PoolTable) WithSuffix(suffix string) *PoolTable {
return newPoolTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newPoolTable(schemaName, tableName, alias string) *PoolTable {
return &PoolTable{
poolTable: newPoolTableImpl(schemaName, tableName, alias),
EXCLUDED: newPoolTableImpl("", "excluded", ""),
}
}
func newPoolTableImpl(schemaName, tableName, alias string) poolTable {
var (
AddressPostalCodeColumn = postgres.StringColumn("address_postal_code")
AddressStreetColumn = postgres.StringColumn("address_street")
CommittedColumn = postgres.BoolColumn("committed")
CreatedColumn = postgres.TimestampColumn("created")
CreatorIDColumn = postgres.IntegerColumn("creator_id")
CsvFileColumn = postgres.IntegerColumn("csv_file")
DeletedColumn = postgres.TimestampColumn("deleted")
GeomColumn = postgres.GeometryColumn("geom")
H3cellColumn = postgres.StringColumn("h3cell")
IDColumn = postgres.IntegerColumn("id")
IsInDistrictColumn = postgres.BoolColumn("is_in_district")
IsNewColumn = postgres.BoolColumn("is_new")
NotesColumn = postgres.StringColumn("notes")
PropertyOwnerNameColumn = postgres.StringColumn("property_owner_name")
PropertyOwnerPhoneE164Column = postgres.StringColumn("property_owner_phone_e164")
ResidentOwnedColumn = postgres.BoolColumn("resident_owned")
ResidentPhoneE164Column = postgres.StringColumn("resident_phone_e164")
LineNumberColumn = postgres.IntegerColumn("line_number")
TagsColumn = postgres.StringColumn("tags")
AddressNumberColumn = postgres.StringColumn("address_number")
AddressLocalityColumn = postgres.StringColumn("address_locality")
AddressRegionColumn = postgres.StringColumn("address_region")
ConditionColumn = postgres.StringColumn("condition")
AddressIDColumn = postgres.IntegerColumn("address_id")
allColumns = postgres.ColumnList{AddressPostalCodeColumn, AddressStreetColumn, CommittedColumn, CreatedColumn, CreatorIDColumn, CsvFileColumn, DeletedColumn, GeomColumn, H3cellColumn, IDColumn, IsInDistrictColumn, IsNewColumn, NotesColumn, PropertyOwnerNameColumn, PropertyOwnerPhoneE164Column, ResidentOwnedColumn, ResidentPhoneE164Column, LineNumberColumn, TagsColumn, AddressNumberColumn, AddressLocalityColumn, AddressRegionColumn, ConditionColumn, AddressIDColumn}
mutableColumns = postgres.ColumnList{AddressPostalCodeColumn, AddressStreetColumn, CommittedColumn, CreatedColumn, CreatorIDColumn, CsvFileColumn, DeletedColumn, GeomColumn, H3cellColumn, IsInDistrictColumn, IsNewColumn, NotesColumn, PropertyOwnerNameColumn, PropertyOwnerPhoneE164Column, ResidentOwnedColumn, ResidentPhoneE164Column, LineNumberColumn, TagsColumn, AddressNumberColumn, AddressLocalityColumn, AddressRegionColumn, ConditionColumn, AddressIDColumn}
defaultColumns = postgres.ColumnList{IDColumn}
)
return poolTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
AddressPostalCode: AddressPostalCodeColumn,
AddressStreet: AddressStreetColumn,
Committed: CommittedColumn,
Created: CreatedColumn,
CreatorID: CreatorIDColumn,
CsvFile: CsvFileColumn,
Deleted: DeletedColumn,
Geom: GeomColumn,
H3cell: H3cellColumn,
ID: IDColumn,
IsInDistrict: IsInDistrictColumn,
IsNew: IsNewColumn,
Notes: NotesColumn,
PropertyOwnerName: PropertyOwnerNameColumn,
PropertyOwnerPhoneE164: PropertyOwnerPhoneE164Column,
ResidentOwned: ResidentOwnedColumn,
ResidentPhoneE164: ResidentPhoneE164Column,
LineNumber: LineNumberColumn,
Tags: TagsColumn,
AddressNumber: AddressNumberColumn,
AddressLocality: AddressLocalityColumn,
AddressRegion: AddressRegionColumn,
Condition: ConditionColumn,
AddressID: AddressIDColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}