Skip to content

app_data

const AppDataSource: DataSource

Defined in: app_data.ts:19

TypeORM DataSource configured for the guild’s PostgreSQL database.

Connection parameters are read from environment variables:

  • PGHOST — database hostname
  • PGPORT — database port
  • PGUSER — database user
  • PGPASSWORD — database password
  • POSTGRES_DB — database name

Entity classes are discovered via the glob ./entities/*.js. Schema synchronisation is disabled — migrations are managed externally.

initializeDataSource(): Promise<void>

Defined in: app_data.ts:39

Initialises the AppDataSource connection pool.

Called once at application startup from index.ts. On failure the process exits with code 1 so Railway restarts it.

Promise<void>