We are launching all new Klivolks 3.0See what is new

init db

nexler init db

needs network
nexler init db [-dir <app-dir>]

Provisions a generated app's "core" system data on its actual core database connection (read from .env's {APPNAME}_DB_CORE_TYPE/_DSN): core_config (backing GetSetting/SetSetting), core_error_log (backing LogError, auto-called on a recovered panic or any 5xx response), core_kgate_channels (backing kgate's channel registry, if init kgate has been run), core_users, and core_services (backing API-key/service-to-service auth, if the app has -auth jwt|both) — each a table plus its own stored procedure for mysql/postgres/mssql, or a unique index for mongo. All five are provisioned unconditionally on every -db app regardless of which optional features are actually used. core_users also carries an org_id column (for -multitenant's core.User.OrgId), provisioned unconditionally too — re-running init db against a database provisioned before org_id existed adds the column via an idempotent ALTER TABLE.

This is a deliberately separate, explicit step — not run automatically by create app or by the app's own startup, since a physical database can be shared by several apps and production setups often run with a low-privilege DB user that can't run DDL at all. Every statement is idempotent — safe to run again, including against a database another app already provisioned. Requires -db to have been set at create app time.

nexler init db -dir ./myapp