feat: use postgres

This commit is contained in:
Ilia Denisov
2026-04-26 20:34:39 +02:00
committed by GitHub
parent 48b0056b49
commit fe829285a6
365 changed files with 29223 additions and 24049 deletions
@@ -0,0 +1,23 @@
//
// 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 model
import (
"time"
)
type Attempts struct {
DeliveryID string `sql:"primary_key"`
AttemptNo int32 `sql:"primary_key"`
Status string
ScheduledFor time.Time
StartedAt *time.Time
FinishedAt *time.Time
ProviderClassification string
ProviderSummary string
}
@@ -0,0 +1,21 @@
//
// 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 model
import (
"time"
)
type DeadLetters struct {
DeliveryID string `sql:"primary_key"`
FinalAttemptNo int32
FailureClassification string
ProviderSummary string
RecoveryHint string
CreatedAt time.Time
}
@@ -0,0 +1,41 @@
//
// 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 model
import (
"time"
)
type Deliveries struct {
DeliveryID string `sql:"primary_key"`
ResendParentDeliveryID string
Source string
Status string
PayloadMode string
TemplateID string
Locale string
LocaleFallbackUsed bool
TemplateVariables *string
Attachments *string
Subject string
TextBody string
HTMLBody string
IdempotencyKey string
RequestFingerprint string
IdempotencyExpiresAt time.Time
AttemptCount int32
LastAttemptStatus string
ProviderSummary string
NextAttemptAt *time.Time
CreatedAt time.Time
UpdatedAt time.Time
SentAt *time.Time
SuppressedAt *time.Time
FailedAt *time.Time
DeadLetteredAt *time.Time
}
@@ -0,0 +1,13 @@
//
// 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 model
type DeliveryPayloads struct {
DeliveryID string `sql:"primary_key"`
Payload string
}
@@ -0,0 +1,15 @@
//
// 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 model
type DeliveryRecipients struct {
DeliveryID string `sql:"primary_key"`
Kind string `sql:"primary_key"`
Position int32 `sql:"primary_key"`
Email string
}
@@ -0,0 +1,19 @@
//
// 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 model
import (
"time"
)
type GooseDbVersion struct {
ID int32 `sql:"primary_key"`
VersionID int64
IsApplied bool
Tstamp time.Time
}
@@ -0,0 +1,23 @@
//
// 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 model
import (
"time"
)
type MalformedCommands struct {
StreamEntryID string `sql:"primary_key"`
DeliveryID string
Source string
IdempotencyKey string
FailureCode string
FailureMessage string
RawFields string
RecordedAt time.Time
}
@@ -0,0 +1,99 @@
//
// 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 Attempts = newAttemptsTable("mail", "attempts", "")
type attemptsTable struct {
postgres.Table
// Columns
DeliveryID postgres.ColumnString
AttemptNo postgres.ColumnInteger
Status postgres.ColumnString
ScheduledFor postgres.ColumnTimestampz
StartedAt postgres.ColumnTimestampz
FinishedAt postgres.ColumnTimestampz
ProviderClassification postgres.ColumnString
ProviderSummary postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type AttemptsTable struct {
attemptsTable
EXCLUDED attemptsTable
}
// AS creates new AttemptsTable with assigned alias
func (a AttemptsTable) AS(alias string) *AttemptsTable {
return newAttemptsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new AttemptsTable with assigned schema name
func (a AttemptsTable) FromSchema(schemaName string) *AttemptsTable {
return newAttemptsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new AttemptsTable with assigned table prefix
func (a AttemptsTable) WithPrefix(prefix string) *AttemptsTable {
return newAttemptsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new AttemptsTable with assigned table suffix
func (a AttemptsTable) WithSuffix(suffix string) *AttemptsTable {
return newAttemptsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newAttemptsTable(schemaName, tableName, alias string) *AttemptsTable {
return &AttemptsTable{
attemptsTable: newAttemptsTableImpl(schemaName, tableName, alias),
EXCLUDED: newAttemptsTableImpl("", "excluded", ""),
}
}
func newAttemptsTableImpl(schemaName, tableName, alias string) attemptsTable {
var (
DeliveryIDColumn = postgres.StringColumn("delivery_id")
AttemptNoColumn = postgres.IntegerColumn("attempt_no")
StatusColumn = postgres.StringColumn("status")
ScheduledForColumn = postgres.TimestampzColumn("scheduled_for")
StartedAtColumn = postgres.TimestampzColumn("started_at")
FinishedAtColumn = postgres.TimestampzColumn("finished_at")
ProviderClassificationColumn = postgres.StringColumn("provider_classification")
ProviderSummaryColumn = postgres.StringColumn("provider_summary")
allColumns = postgres.ColumnList{DeliveryIDColumn, AttemptNoColumn, StatusColumn, ScheduledForColumn, StartedAtColumn, FinishedAtColumn, ProviderClassificationColumn, ProviderSummaryColumn}
mutableColumns = postgres.ColumnList{StatusColumn, ScheduledForColumn, StartedAtColumn, FinishedAtColumn, ProviderClassificationColumn, ProviderSummaryColumn}
defaultColumns = postgres.ColumnList{ProviderClassificationColumn, ProviderSummaryColumn}
)
return attemptsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
DeliveryID: DeliveryIDColumn,
AttemptNo: AttemptNoColumn,
Status: StatusColumn,
ScheduledFor: ScheduledForColumn,
StartedAt: StartedAtColumn,
FinishedAt: FinishedAtColumn,
ProviderClassification: ProviderClassificationColumn,
ProviderSummary: ProviderSummaryColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,93 @@
//
// 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 DeadLetters = newDeadLettersTable("mail", "dead_letters", "")
type deadLettersTable struct {
postgres.Table
// Columns
DeliveryID postgres.ColumnString
FinalAttemptNo postgres.ColumnInteger
FailureClassification postgres.ColumnString
ProviderSummary postgres.ColumnString
RecoveryHint postgres.ColumnString
CreatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type DeadLettersTable struct {
deadLettersTable
EXCLUDED deadLettersTable
}
// AS creates new DeadLettersTable with assigned alias
func (a DeadLettersTable) AS(alias string) *DeadLettersTable {
return newDeadLettersTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new DeadLettersTable with assigned schema name
func (a DeadLettersTable) FromSchema(schemaName string) *DeadLettersTable {
return newDeadLettersTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new DeadLettersTable with assigned table prefix
func (a DeadLettersTable) WithPrefix(prefix string) *DeadLettersTable {
return newDeadLettersTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new DeadLettersTable with assigned table suffix
func (a DeadLettersTable) WithSuffix(suffix string) *DeadLettersTable {
return newDeadLettersTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newDeadLettersTable(schemaName, tableName, alias string) *DeadLettersTable {
return &DeadLettersTable{
deadLettersTable: newDeadLettersTableImpl(schemaName, tableName, alias),
EXCLUDED: newDeadLettersTableImpl("", "excluded", ""),
}
}
func newDeadLettersTableImpl(schemaName, tableName, alias string) deadLettersTable {
var (
DeliveryIDColumn = postgres.StringColumn("delivery_id")
FinalAttemptNoColumn = postgres.IntegerColumn("final_attempt_no")
FailureClassificationColumn = postgres.StringColumn("failure_classification")
ProviderSummaryColumn = postgres.StringColumn("provider_summary")
RecoveryHintColumn = postgres.StringColumn("recovery_hint")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
allColumns = postgres.ColumnList{DeliveryIDColumn, FinalAttemptNoColumn, FailureClassificationColumn, ProviderSummaryColumn, RecoveryHintColumn, CreatedAtColumn}
mutableColumns = postgres.ColumnList{FinalAttemptNoColumn, FailureClassificationColumn, ProviderSummaryColumn, RecoveryHintColumn, CreatedAtColumn}
defaultColumns = postgres.ColumnList{ProviderSummaryColumn, RecoveryHintColumn}
)
return deadLettersTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
DeliveryID: DeliveryIDColumn,
FinalAttemptNo: FinalAttemptNoColumn,
FailureClassification: FailureClassificationColumn,
ProviderSummary: ProviderSummaryColumn,
RecoveryHint: RecoveryHintColumn,
CreatedAt: CreatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,153 @@
//
// 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 Deliveries = newDeliveriesTable("mail", "deliveries", "")
type deliveriesTable struct {
postgres.Table
// Columns
DeliveryID postgres.ColumnString
ResendParentDeliveryID postgres.ColumnString
Source postgres.ColumnString
Status postgres.ColumnString
PayloadMode postgres.ColumnString
TemplateID postgres.ColumnString
Locale postgres.ColumnString
LocaleFallbackUsed postgres.ColumnBool
TemplateVariables postgres.ColumnString
Attachments postgres.ColumnString
Subject postgres.ColumnString
TextBody postgres.ColumnString
HTMLBody postgres.ColumnString
IdempotencyKey postgres.ColumnString
RequestFingerprint postgres.ColumnString
IdempotencyExpiresAt postgres.ColumnTimestampz
AttemptCount postgres.ColumnInteger
LastAttemptStatus postgres.ColumnString
ProviderSummary postgres.ColumnString
NextAttemptAt postgres.ColumnTimestampz
CreatedAt postgres.ColumnTimestampz
UpdatedAt postgres.ColumnTimestampz
SentAt postgres.ColumnTimestampz
SuppressedAt postgres.ColumnTimestampz
FailedAt postgres.ColumnTimestampz
DeadLetteredAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type DeliveriesTable struct {
deliveriesTable
EXCLUDED deliveriesTable
}
// AS creates new DeliveriesTable with assigned alias
func (a DeliveriesTable) AS(alias string) *DeliveriesTable {
return newDeliveriesTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new DeliveriesTable with assigned schema name
func (a DeliveriesTable) FromSchema(schemaName string) *DeliveriesTable {
return newDeliveriesTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new DeliveriesTable with assigned table prefix
func (a DeliveriesTable) WithPrefix(prefix string) *DeliveriesTable {
return newDeliveriesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new DeliveriesTable with assigned table suffix
func (a DeliveriesTable) WithSuffix(suffix string) *DeliveriesTable {
return newDeliveriesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newDeliveriesTable(schemaName, tableName, alias string) *DeliveriesTable {
return &DeliveriesTable{
deliveriesTable: newDeliveriesTableImpl(schemaName, tableName, alias),
EXCLUDED: newDeliveriesTableImpl("", "excluded", ""),
}
}
func newDeliveriesTableImpl(schemaName, tableName, alias string) deliveriesTable {
var (
DeliveryIDColumn = postgres.StringColumn("delivery_id")
ResendParentDeliveryIDColumn = postgres.StringColumn("resend_parent_delivery_id")
SourceColumn = postgres.StringColumn("source")
StatusColumn = postgres.StringColumn("status")
PayloadModeColumn = postgres.StringColumn("payload_mode")
TemplateIDColumn = postgres.StringColumn("template_id")
LocaleColumn = postgres.StringColumn("locale")
LocaleFallbackUsedColumn = postgres.BoolColumn("locale_fallback_used")
TemplateVariablesColumn = postgres.StringColumn("template_variables")
AttachmentsColumn = postgres.StringColumn("attachments")
SubjectColumn = postgres.StringColumn("subject")
TextBodyColumn = postgres.StringColumn("text_body")
HTMLBodyColumn = postgres.StringColumn("html_body")
IdempotencyKeyColumn = postgres.StringColumn("idempotency_key")
RequestFingerprintColumn = postgres.StringColumn("request_fingerprint")
IdempotencyExpiresAtColumn = postgres.TimestampzColumn("idempotency_expires_at")
AttemptCountColumn = postgres.IntegerColumn("attempt_count")
LastAttemptStatusColumn = postgres.StringColumn("last_attempt_status")
ProviderSummaryColumn = postgres.StringColumn("provider_summary")
NextAttemptAtColumn = postgres.TimestampzColumn("next_attempt_at")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
SentAtColumn = postgres.TimestampzColumn("sent_at")
SuppressedAtColumn = postgres.TimestampzColumn("suppressed_at")
FailedAtColumn = postgres.TimestampzColumn("failed_at")
DeadLetteredAtColumn = postgres.TimestampzColumn("dead_lettered_at")
allColumns = postgres.ColumnList{DeliveryIDColumn, ResendParentDeliveryIDColumn, SourceColumn, StatusColumn, PayloadModeColumn, TemplateIDColumn, LocaleColumn, LocaleFallbackUsedColumn, TemplateVariablesColumn, AttachmentsColumn, SubjectColumn, TextBodyColumn, HTMLBodyColumn, IdempotencyKeyColumn, RequestFingerprintColumn, IdempotencyExpiresAtColumn, AttemptCountColumn, LastAttemptStatusColumn, ProviderSummaryColumn, NextAttemptAtColumn, CreatedAtColumn, UpdatedAtColumn, SentAtColumn, SuppressedAtColumn, FailedAtColumn, DeadLetteredAtColumn}
mutableColumns = postgres.ColumnList{ResendParentDeliveryIDColumn, SourceColumn, StatusColumn, PayloadModeColumn, TemplateIDColumn, LocaleColumn, LocaleFallbackUsedColumn, TemplateVariablesColumn, AttachmentsColumn, SubjectColumn, TextBodyColumn, HTMLBodyColumn, IdempotencyKeyColumn, RequestFingerprintColumn, IdempotencyExpiresAtColumn, AttemptCountColumn, LastAttemptStatusColumn, ProviderSummaryColumn, NextAttemptAtColumn, CreatedAtColumn, UpdatedAtColumn, SentAtColumn, SuppressedAtColumn, FailedAtColumn, DeadLetteredAtColumn}
defaultColumns = postgres.ColumnList{ResendParentDeliveryIDColumn, TemplateIDColumn, LocaleColumn, LocaleFallbackUsedColumn, SubjectColumn, TextBodyColumn, HTMLBodyColumn, AttemptCountColumn, LastAttemptStatusColumn, ProviderSummaryColumn}
)
return deliveriesTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
DeliveryID: DeliveryIDColumn,
ResendParentDeliveryID: ResendParentDeliveryIDColumn,
Source: SourceColumn,
Status: StatusColumn,
PayloadMode: PayloadModeColumn,
TemplateID: TemplateIDColumn,
Locale: LocaleColumn,
LocaleFallbackUsed: LocaleFallbackUsedColumn,
TemplateVariables: TemplateVariablesColumn,
Attachments: AttachmentsColumn,
Subject: SubjectColumn,
TextBody: TextBodyColumn,
HTMLBody: HTMLBodyColumn,
IdempotencyKey: IdempotencyKeyColumn,
RequestFingerprint: RequestFingerprintColumn,
IdempotencyExpiresAt: IdempotencyExpiresAtColumn,
AttemptCount: AttemptCountColumn,
LastAttemptStatus: LastAttemptStatusColumn,
ProviderSummary: ProviderSummaryColumn,
NextAttemptAt: NextAttemptAtColumn,
CreatedAt: CreatedAtColumn,
UpdatedAt: UpdatedAtColumn,
SentAt: SentAtColumn,
SuppressedAt: SuppressedAtColumn,
FailedAt: FailedAtColumn,
DeadLetteredAt: DeadLetteredAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,81 @@
//
// 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 DeliveryPayloads = newDeliveryPayloadsTable("mail", "delivery_payloads", "")
type deliveryPayloadsTable struct {
postgres.Table
// Columns
DeliveryID postgres.ColumnString
Payload postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type DeliveryPayloadsTable struct {
deliveryPayloadsTable
EXCLUDED deliveryPayloadsTable
}
// AS creates new DeliveryPayloadsTable with assigned alias
func (a DeliveryPayloadsTable) AS(alias string) *DeliveryPayloadsTable {
return newDeliveryPayloadsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new DeliveryPayloadsTable with assigned schema name
func (a DeliveryPayloadsTable) FromSchema(schemaName string) *DeliveryPayloadsTable {
return newDeliveryPayloadsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new DeliveryPayloadsTable with assigned table prefix
func (a DeliveryPayloadsTable) WithPrefix(prefix string) *DeliveryPayloadsTable {
return newDeliveryPayloadsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new DeliveryPayloadsTable with assigned table suffix
func (a DeliveryPayloadsTable) WithSuffix(suffix string) *DeliveryPayloadsTable {
return newDeliveryPayloadsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newDeliveryPayloadsTable(schemaName, tableName, alias string) *DeliveryPayloadsTable {
return &DeliveryPayloadsTable{
deliveryPayloadsTable: newDeliveryPayloadsTableImpl(schemaName, tableName, alias),
EXCLUDED: newDeliveryPayloadsTableImpl("", "excluded", ""),
}
}
func newDeliveryPayloadsTableImpl(schemaName, tableName, alias string) deliveryPayloadsTable {
var (
DeliveryIDColumn = postgres.StringColumn("delivery_id")
PayloadColumn = postgres.StringColumn("payload")
allColumns = postgres.ColumnList{DeliveryIDColumn, PayloadColumn}
mutableColumns = postgres.ColumnList{PayloadColumn}
defaultColumns = postgres.ColumnList{}
)
return deliveryPayloadsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
DeliveryID: DeliveryIDColumn,
Payload: PayloadColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,87 @@
//
// 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 DeliveryRecipients = newDeliveryRecipientsTable("mail", "delivery_recipients", "")
type deliveryRecipientsTable struct {
postgres.Table
// Columns
DeliveryID postgres.ColumnString
Kind postgres.ColumnString
Position postgres.ColumnInteger
Email postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type DeliveryRecipientsTable struct {
deliveryRecipientsTable
EXCLUDED deliveryRecipientsTable
}
// AS creates new DeliveryRecipientsTable with assigned alias
func (a DeliveryRecipientsTable) AS(alias string) *DeliveryRecipientsTable {
return newDeliveryRecipientsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new DeliveryRecipientsTable with assigned schema name
func (a DeliveryRecipientsTable) FromSchema(schemaName string) *DeliveryRecipientsTable {
return newDeliveryRecipientsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new DeliveryRecipientsTable with assigned table prefix
func (a DeliveryRecipientsTable) WithPrefix(prefix string) *DeliveryRecipientsTable {
return newDeliveryRecipientsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new DeliveryRecipientsTable with assigned table suffix
func (a DeliveryRecipientsTable) WithSuffix(suffix string) *DeliveryRecipientsTable {
return newDeliveryRecipientsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newDeliveryRecipientsTable(schemaName, tableName, alias string) *DeliveryRecipientsTable {
return &DeliveryRecipientsTable{
deliveryRecipientsTable: newDeliveryRecipientsTableImpl(schemaName, tableName, alias),
EXCLUDED: newDeliveryRecipientsTableImpl("", "excluded", ""),
}
}
func newDeliveryRecipientsTableImpl(schemaName, tableName, alias string) deliveryRecipientsTable {
var (
DeliveryIDColumn = postgres.StringColumn("delivery_id")
KindColumn = postgres.StringColumn("kind")
PositionColumn = postgres.IntegerColumn("position")
EmailColumn = postgres.StringColumn("email")
allColumns = postgres.ColumnList{DeliveryIDColumn, KindColumn, PositionColumn, EmailColumn}
mutableColumns = postgres.ColumnList{EmailColumn}
defaultColumns = postgres.ColumnList{}
)
return deliveryRecipientsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
DeliveryID: DeliveryIDColumn,
Kind: KindColumn,
Position: PositionColumn,
Email: EmailColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,87 @@
//
// 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 GooseDbVersion = newGooseDbVersionTable("mail", "goose_db_version", "")
type gooseDbVersionTable struct {
postgres.Table
// Columns
ID postgres.ColumnInteger
VersionID postgres.ColumnInteger
IsApplied postgres.ColumnBool
Tstamp postgres.ColumnTimestamp
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type GooseDbVersionTable struct {
gooseDbVersionTable
EXCLUDED gooseDbVersionTable
}
// AS creates new GooseDbVersionTable with assigned alias
func (a GooseDbVersionTable) AS(alias string) *GooseDbVersionTable {
return newGooseDbVersionTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new GooseDbVersionTable with assigned schema name
func (a GooseDbVersionTable) FromSchema(schemaName string) *GooseDbVersionTable {
return newGooseDbVersionTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new GooseDbVersionTable with assigned table prefix
func (a GooseDbVersionTable) WithPrefix(prefix string) *GooseDbVersionTable {
return newGooseDbVersionTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new GooseDbVersionTable with assigned table suffix
func (a GooseDbVersionTable) WithSuffix(suffix string) *GooseDbVersionTable {
return newGooseDbVersionTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newGooseDbVersionTable(schemaName, tableName, alias string) *GooseDbVersionTable {
return &GooseDbVersionTable{
gooseDbVersionTable: newGooseDbVersionTableImpl(schemaName, tableName, alias),
EXCLUDED: newGooseDbVersionTableImpl("", "excluded", ""),
}
}
func newGooseDbVersionTableImpl(schemaName, tableName, alias string) gooseDbVersionTable {
var (
IDColumn = postgres.IntegerColumn("id")
VersionIDColumn = postgres.IntegerColumn("version_id")
IsAppliedColumn = postgres.BoolColumn("is_applied")
TstampColumn = postgres.TimestampColumn("tstamp")
allColumns = postgres.ColumnList{IDColumn, VersionIDColumn, IsAppliedColumn, TstampColumn}
mutableColumns = postgres.ColumnList{VersionIDColumn, IsAppliedColumn, TstampColumn}
defaultColumns = postgres.ColumnList{TstampColumn}
)
return gooseDbVersionTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ID: IDColumn,
VersionID: VersionIDColumn,
IsApplied: IsAppliedColumn,
Tstamp: TstampColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,99 @@
//
// 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 MalformedCommands = newMalformedCommandsTable("mail", "malformed_commands", "")
type malformedCommandsTable struct {
postgres.Table
// Columns
StreamEntryID postgres.ColumnString
DeliveryID postgres.ColumnString
Source postgres.ColumnString
IdempotencyKey postgres.ColumnString
FailureCode postgres.ColumnString
FailureMessage postgres.ColumnString
RawFields postgres.ColumnString
RecordedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type MalformedCommandsTable struct {
malformedCommandsTable
EXCLUDED malformedCommandsTable
}
// AS creates new MalformedCommandsTable with assigned alias
func (a MalformedCommandsTable) AS(alias string) *MalformedCommandsTable {
return newMalformedCommandsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new MalformedCommandsTable with assigned schema name
func (a MalformedCommandsTable) FromSchema(schemaName string) *MalformedCommandsTable {
return newMalformedCommandsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new MalformedCommandsTable with assigned table prefix
func (a MalformedCommandsTable) WithPrefix(prefix string) *MalformedCommandsTable {
return newMalformedCommandsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new MalformedCommandsTable with assigned table suffix
func (a MalformedCommandsTable) WithSuffix(suffix string) *MalformedCommandsTable {
return newMalformedCommandsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newMalformedCommandsTable(schemaName, tableName, alias string) *MalformedCommandsTable {
return &MalformedCommandsTable{
malformedCommandsTable: newMalformedCommandsTableImpl(schemaName, tableName, alias),
EXCLUDED: newMalformedCommandsTableImpl("", "excluded", ""),
}
}
func newMalformedCommandsTableImpl(schemaName, tableName, alias string) malformedCommandsTable {
var (
StreamEntryIDColumn = postgres.StringColumn("stream_entry_id")
DeliveryIDColumn = postgres.StringColumn("delivery_id")
SourceColumn = postgres.StringColumn("source")
IdempotencyKeyColumn = postgres.StringColumn("idempotency_key")
FailureCodeColumn = postgres.StringColumn("failure_code")
FailureMessageColumn = postgres.StringColumn("failure_message")
RawFieldsColumn = postgres.StringColumn("raw_fields")
RecordedAtColumn = postgres.TimestampzColumn("recorded_at")
allColumns = postgres.ColumnList{StreamEntryIDColumn, DeliveryIDColumn, SourceColumn, IdempotencyKeyColumn, FailureCodeColumn, FailureMessageColumn, RawFieldsColumn, RecordedAtColumn}
mutableColumns = postgres.ColumnList{DeliveryIDColumn, SourceColumn, IdempotencyKeyColumn, FailureCodeColumn, FailureMessageColumn, RawFieldsColumn, RecordedAtColumn}
defaultColumns = postgres.ColumnList{DeliveryIDColumn, SourceColumn, IdempotencyKeyColumn}
)
return malformedCommandsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
StreamEntryID: StreamEntryIDColumn,
DeliveryID: DeliveryIDColumn,
Source: SourceColumn,
IdempotencyKey: IdempotencyKeyColumn,
FailureCode: FailureCodeColumn,
FailureMessage: FailureMessageColumn,
RawFields: RawFieldsColumn,
RecordedAt: RecordedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,20 @@
//
// 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
// UseSchema sets a new schema name for all generated table SQL builder types. It is recommended to invoke
// this method only once at the beginning of the program.
func UseSchema(schema string) {
Attempts = Attempts.FromSchema(schema)
DeadLetters = DeadLetters.FromSchema(schema)
Deliveries = Deliveries.FromSchema(schema)
DeliveryPayloads = DeliveryPayloads.FromSchema(schema)
DeliveryRecipients = DeliveryRecipients.FromSchema(schema)
GooseDbVersion = GooseDbVersion.FromSchema(schema)
MalformedCommands = MalformedCommands.FromSchema(schema)
}