This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/server/store/postgres/stores.go
Jeffrey Smith c3e9dcf731 step 3: gut store interfaces and models
- interfaces.go: 1449 → 437 lines (13 kernel interfaces from 33)
- models.go: 1137 → 397 lines (17 kernel types from 64)
- Deleted 28 store impl files per dialect (PG + SQLite)
- Deleted 3 model files (git, memory, workspace)
- Deleted 3 store iface files (project, memory, tree_types)
- Rewrote stores.go constructors for both PG and SQLite
- Stores struct: 20 fields (from 40+, includes separate iface stores)

66 files changed, ~19K lines removed.
Build will break — expected, fixed in steps 4-5.
2026-03-25 19:58:14 -04:00

36 lines
1.1 KiB
Go

package postgres
import (
"database/sql"
"switchboard-core/store"
)
// NewStores creates all Postgres store implementations and wires them
// into the Stores bundle. Call this at startup after database.Connect().
func NewStores(db *sql.DB) store.Stores {
SetDB(db)
return store.Stores{
Users: NewUserStore(),
Teams: NewTeamStore(),
Audit: NewAuditStore(),
GlobalConfig: NewGlobalConfigStore(),
Groups: NewGroupStore(),
ResourceGrants: NewResourceGrantStore(),
Notifications: NewNotificationStore(),
NotifPrefs: NewNotificationPreferenceStore(),
Sessions: NewSessionStore(),
Presence: NewPresenceStore(),
Health: NewHealthStore(db),
Connections: NewConnectionStore(),
Dependencies: NewDependencyStore(),
Packages: NewPackageStore(),
Workflows: NewWorkflowStore(),
Tasks: NewTaskStore(),
ExtPermissions: NewExtensionPermissionStore(db),
ExtData: NewExtDataStore(db),
Tickets: NewTicketStore(),
RateLimits: NewRateLimitStore(),
}
}