Skip to content

Database Tables Reference

All StackSync database tables organized by domain. Public schema unless noted otherwise.


Core Entities

Table Description
users User accounts. PK: user_id (bigint serial). Has auth0_id, email, options (jsonb for partner info).
workspaces Workspaces group users and resources. PK: workspace_id (bigint serial). Has plan, options, data_protection_configuration.
user_roles Maps users to workspaces with roles (owner/editor/viewer). Unique on (user_id, workspace_id).
bases Syncs. PK: base_id (uuid). Contains base_schema (jsonb), base_status, triggers, options. Soft-deleted via base_status='removed'.
connections OAuth/API credentials for external apps. PK: connection_id (uuid). Credentials are encrypted.
connections_providers Custom OAuth providers per workspace (BYOC -- bring your own credentials).
credentials Legacy per-app credentials table. PK: app_id. Being replaced by connections.
folders Resource folder structure for organizing syncs, workflows, etc.
workflows Workflow definitions. PK: workflow_id. Soft-deleted via workflow_status='deleted'.
workflows_versions Versioned workflow schemas (draft/deployed). Each version has full workflow_schema jsonb.
workflows_modules Module registry -- available workflow building blocks (triggers, actions, etc.).
workflows_app_queues App queues for workflow buffering. Has flush_batch_size, flush_strategy (fifo).
workflows_apps_private Private/custom workflow apps per workspace.
workflows_variables Workspace-scoped variables (secrets/config) for workflows. Encrypted data.
workflow_email_routes Maps email aliases to workflow triggers for email-triggered workflows.
api_proxy_services API proxy configurations per workspace.
api_proxy_credentials API tokens for accessing api_proxy_services.
partners Partner configurations for white-labeling (branding jsonb, SSO, API keys).
files File storage references (S3). Tracks workspace_id, mime_type, size, tags.

Scheduling and Queues

Table Description
schedule_generic Generic task scheduler. Controls frequency, concurrency, adaptive frequency. Main scheduler table.
schedule_generic_connector_ping Connector read ping scheduler (older, being replaced by schedule_generic).
schedule_big_query_ping BigQuery-specific read ping scheduler.
schedule_big_query_stream BigQuery stream tracking per base/app/table.
schedule_generic_adaptive_frequency_functions Python code for adaptive frequency calculations.
tasks_metadata Scheduled jobs/tasks metadata (workspace-level cron-like tasks).
tasks_queue Execution queue for scheduled tasks.
changes Legacy global changes queue. Being replaced by per-base changes_table.
changes_rate_limiting Rate limits for change processing per app. TTL-based (1 hour).
queue_rate_limiting Rate limits for app queue execution.
notifications_queue Queue for sending user notifications (email, etc.).
events_to_be_processed Queue for webhook events that arrived during service downtime. Includes retry logic.
error_filter_queue Queue for filtering/processing errors.
association_queue Queue for processing HubSpot-style associations.
phingoo_crm_queue CRM integration queue.

Errors and Monitoring

Table Description
errors Active write errors per record. PK: (app_id, internal_rec_id).
errors_ignored Dismissed errors. TTL: 7 days.
record_locks Global record locks to prevent concurrent writes. TTL: 1 minute.
rescrape_records Global rescrape queue (being replaced by per-base version).
scan_rate_limiting Global scan rate limiting (being replaced by per-base version).
ongoing_write_processes_in_utc Tracks ongoing write processes globally.
logs Global application logs.

Auth and Users

Table Description
admins Admin users (internal StackSync staff). PK: auth0_id.
access_rights Permission matrix: what each role (owner/editor/viewer) can do per action.
invites Pending workspace invitations. Unique per (workspace_id, email).
email_changes Pending email change requests.
notification_configurations Notification type configs: which roles get which notifications via which channels.

Referrals and Billing

Table Description
referral_links Referral URLs per user.
referral_events Referral activity log (signups, payments).
referral_commissions Commission tracking for referrers.

Internal Services

Table Description
services Service registry (connectors, frontend-logics, etc.) with regions, URLs, cloud projects.
services2 Legacy duplicate of services table.
services_access_tokens Internal service-to-service auth tokens with expiry.
datatypes Data type mapping (external to internal type conversion).
apps_branding App display metadata (icons, names) for the UI.
interim_app_credentials Temporary credentials during OAuth flow. TTL: 24 hours.
interim_ssh_private_keys Temporary SSH key pairs for DB tunnel connections.
values_cache Generic key-value cache with TTL (default 30 min).
product_announcement_banners In-app announcement banners.
generic_connectors Custom/generic connector deployments.
iac_workspace_associations Infrastructure-as-code workspace mapping.
saved_explorer_queries Saved SQL/query explorer queries per workspace.

Copilot

Table Description
copilot_conversations AI copilot conversation threads.
copilot_messages Individual messages within copilot conversations.
copilot_task_contexts Task context/memory for copilot conversations.
copilot_llm_monitor_logs LLM API call logs (prompts, responses, timing).

Alerts and Monitoring

Table Description
alerts_queue Support alert queue from Slack channels. Has urgency scoring.
slack_channels_state Tracks Slack channel read state for alert monitoring.
cdc_with_constantly_open_stateful_connections_listeners CDC listener registry (MySQL binlog, etc.).
cdc_with_constantly_open_stateful_connections_service_instances CDC service instance heartbeats.
twilio_messages Twilio SMS message log.

Per-Base Tables

Schema: base_{baseIdNoDashes}

Each sync (base) gets its own schema with dynamically named tables scoped to its apps and tables.

Table Pattern Description
changes_table_{internal_table_id} Change queue per table -- detected changes waiting to be written.
datastore_app_{app_id}_table_{internal_table_id} Main record store -- maps internal to external record IDs with hashes.
event_forward_credentials_app_{app_id} Webhook credentials for event-forwarding apps.
issues_app_{app_id}_table_{internal_table_id} Active write issues (sync errors) per record.
issues_ignored_app_{app_id}_table_{internal_table_id} User-dismissed issues.
ongoing_write_to_external_app_app_{app_id}_table_{internal_table_id} Tracks in-flight writes for conflict detection.
record_locks_table_{internal_table_id} Per-base record locks.
rescrape_records_app_{app_id}_table_{internal_table_id} Records queued for re-reading from external app.
scan_rate_limiting_app_{app_id}_table_{internal_table_id} Controls read scan frequency per app/table.
writers_rate_limiting_app_{app_id} Tracks active writer processes per app.
base_logs Per-base logs, partitioned by log_type (default, external_app_request, monitoring).
base_stats Per-base statistics (e.g. changes count). Unique on (app_id, internal_table_id, stat_name).
app_schemas_versioning Historical snapshots of app schemas for this base.
read_full_monitoring Tracks full-read operations (start time, end time, options).
record_level_monitoring_{app_id} Detailed per-record pipeline tracking. Partitioned by date. 49 columns covering every pipeline stage.

Per-Workflow Tables

Schema: wf_*

Table Description
app_queue Workflow app queue items. Encrypted data.
app_queue_logs Workflow app queue processing logs.
workflow_execution_queue Queued workflow executions waiting to run.
workflow_execution_logs Execution logs per workflow run (per module, status, timing).