BryanNet

Database diagnostics and safe query reference

Prerequisites and authority

Use this reference with your installed release. Internal implementation routes and settings are not public integration contracts.

Conceptual data model and safe diagnostics

A customer owns subscriptions and payments. A subscription refers to a plan and tracks validity, quota and activation. Payments can link to subscriptions but retain independent economic/provisioning status. Router accounts, router sessions, devices and accounting segments represent network execution. Application sessions are separate from internet sessions.

Approved public diagnostic examples should select narrow non-secret columns. Avoid SELECT * from accounts, settings, administrators or credential-bearing tables. Use a read-only support account and restrict the time/record scope.

The following identifiers were inspected in current models. They are source-checked, not executed against a release database. Run schema inspection first; replace 123 with an authorized known customer ID.

SELECT customer_id, status, is_registered, created_at
FROM customers
WHERE customer_id = 123;

SELECT payment_id, customer_id, plan_id, subscription_id,
       status, provisioning_status, amount, payment_reference, payment_date
FROM payments
WHERE customer_id = 123
ORDER BY created_at DESC
LIMIT 20;

SELECT subscription_id, customer_id, plan_id, status,
       start_date, expiry_date, activated_at, activation_sequence,
       plan_type, data_quota_bytes, data_used_bytes, dates_are_explicit
FROM subscriptions
WHERE customer_id = 123
ORDER BY activation_sequence, subscription_id
LIMIT 50;

References and IDs can still be sensitive. Keep raw output private and redact before sharing. A SELECT can impose load, so keep limits and avoid unbounded joins.

The inspected router_sessions model uses login_at/logout_at and links through router_account_id; it does not declare customer_id. Historical queries that filter router sessions directly by customer therefore need a verified join. Do not publish guessed column names.

Use SHOW COLUMNS FROM subscriptions; to inspect identifiers with read-only authority before writing a diagnostic query for your installed version. Database writes belong to separately reviewed repair procedures, not this reference.

Related guides

Related guides: Configuration reference (env vars, ports, URLs), Docker services, Compose files and persistent volumes, Subscription and provisioning state model.