eeaad62b10
- internal/postgres: pgx-over-database/sql pool (otelsql), embedded goose
migrations into schema 'backend', committed go-jet code + cmd/jetgen tool.
- internal/account: durable accounts + unified telegram/email identities
(UUIDv7 keys), find-or-create provisioning with unique-conflict handling.
- internal/session: opaque 256-bit tokens stored as a SHA-256 hash, revoke-only
(no TTL); write-through cache gating /readyz; store + service.
- internal/telemetry: OTel tracer/meter providers (none/stdout) + request-timing
middleware; internal/config gains Postgres + OTel env loading.
- internal/server: /api/v1 {public,user,internal,admin} skeleton + X-User-ID
middleware; /readyz checks DB ping + cache; main wires
telemetry -> db+migrate -> warm cache -> server.
- Tests: unit + integration (build tag 'integration', testcontainers
postgres:17) for migrations, accounts, sessions, readyz; new integration.yaml.
- Docs: ARCHITECTURE, TESTING, PLAN refinements, root + backend READMEs.
Session/account REST handlers deferred to Stage 6 (gateway); OTLP + dashboards
to Stage 11.
94 lines
2.9 KiB
Go
94 lines
2.9 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 Identities = newIdentitiesTable("backend", "identities", "")
|
|
|
|
type identitiesTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
IdentityID postgres.ColumnString
|
|
AccountID postgres.ColumnString
|
|
Kind postgres.ColumnString
|
|
ExternalID postgres.ColumnString
|
|
Confirmed postgres.ColumnBool
|
|
CreatedAt postgres.ColumnTimestampz
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
DefaultColumns postgres.ColumnList
|
|
}
|
|
|
|
type IdentitiesTable struct {
|
|
identitiesTable
|
|
|
|
EXCLUDED identitiesTable
|
|
}
|
|
|
|
// AS creates new IdentitiesTable with assigned alias
|
|
func (a IdentitiesTable) AS(alias string) *IdentitiesTable {
|
|
return newIdentitiesTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new IdentitiesTable with assigned schema name
|
|
func (a IdentitiesTable) FromSchema(schemaName string) *IdentitiesTable {
|
|
return newIdentitiesTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new IdentitiesTable with assigned table prefix
|
|
func (a IdentitiesTable) WithPrefix(prefix string) *IdentitiesTable {
|
|
return newIdentitiesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new IdentitiesTable with assigned table suffix
|
|
func (a IdentitiesTable) WithSuffix(suffix string) *IdentitiesTable {
|
|
return newIdentitiesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newIdentitiesTable(schemaName, tableName, alias string) *IdentitiesTable {
|
|
return &IdentitiesTable{
|
|
identitiesTable: newIdentitiesTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newIdentitiesTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newIdentitiesTableImpl(schemaName, tableName, alias string) identitiesTable {
|
|
var (
|
|
IdentityIDColumn = postgres.StringColumn("identity_id")
|
|
AccountIDColumn = postgres.StringColumn("account_id")
|
|
KindColumn = postgres.StringColumn("kind")
|
|
ExternalIDColumn = postgres.StringColumn("external_id")
|
|
ConfirmedColumn = postgres.BoolColumn("confirmed")
|
|
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
|
allColumns = postgres.ColumnList{IdentityIDColumn, AccountIDColumn, KindColumn, ExternalIDColumn, ConfirmedColumn, CreatedAtColumn}
|
|
mutableColumns = postgres.ColumnList{AccountIDColumn, KindColumn, ExternalIDColumn, ConfirmedColumn, CreatedAtColumn}
|
|
defaultColumns = postgres.ColumnList{ConfirmedColumn, CreatedAtColumn}
|
|
)
|
|
|
|
return identitiesTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
IdentityID: IdentityIDColumn,
|
|
AccountID: AccountIDColumn,
|
|
Kind: KindColumn,
|
|
ExternalID: ExternalIDColumn,
|
|
Confirmed: ConfirmedColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
DefaultColumns: defaultColumns,
|
|
}
|
|
}
|