| connector | to-one (Connector) | โ
Yes | The canonical connector definition this instance activates. Carries provider type, category/service IDs, authorization flow, transport type, auth_config (OAuth metadata URL, MCP server URL), and supported target models. A single Connector can have many workspace_connector activations across different workspaces. |
| workspace | to-one (Workspace) | โ
Yes | The workspace that owns and operates this connector instance. Acts as the tenant boundary: every sync run, entity ingested, and sync target scoped to this workspace_connector is isolated within this workspace. |
| person | to-one (People) | โช No | The person (workspace member) who owns or administered the connection. Optional โ connectors created programmatically (e.g. via API key or admin seeding) may have no person owner. Indexed via idx_workspace_connectors_person. |
| filter (virtual) | to-one (ConnectorFilter) | โช No | Virtual property โ NOT a persisted FK column. Populated at query time by WorkspaceConnectorRepository. Resolves to either a custom ConnectorFilter for this workspace, or the template filter for the connector. Controls what data is ingested (e.g. date range, account scope). Not stored on the workspace_connectors table itself. |
| syncTargets (WorkspaceConnectorSyncTarget) โ inverse reference | to-many (WorkspaceConnectorSyncTarget) | โช No | Inverse reference โ NOT declared as @OneToMany on WorkspaceConnector. WorkspaceConnectorSyncTarget declares @ManyToOne(() => WorkspaceConnector). Junction rows defining which target workspaces this connector ingests data into (added in Migration20260527140000). Each row links this connector to a target_workspace_pk. Partial unique index idx_wcst_unique_active prevents duplicate active targets. Backfilled with a 1:1 self-pointing row for all pre-existing connectors. |
| connectorMappings (ConnectorMapping) โ inverse reference | to-many (ConnectorMapping) | โช No | Inverse reference โ NOT declared as @OneToMany on WorkspaceConnector. ConnectorMapping declares @ManyToOne({ entity: () => WorkspaceConnector, fieldName: 'workspace_connector_pk' }). The JSONata sync mapping configurations generated by the structured-jury pipeline for each target model (company, invoice, transaction, etc.). One mapping row per (workspace_connector, target_model). Holds the compiled JSONata expression, last_persist_count, and needs_regeneration flag. |
| syncDiagnostics (ConnectorSyncDiagnostic) โ inverse reference | to-many (ConnectorSyncDiagnostic) | โช No | Inverse reference โ NOT declared as @OneToMany on WorkspaceConnector. ConnectorSyncDiagnostic declares @ManyToOne({ entity: () => WorkspaceConnector, fieldName: 'workspace_connector_pk' }). Diagnostic and observability rows emitted by the sync pipeline โ jury runs, schema drift, mapping failures, regression reverts. Each row references this workspace_connector as the sync context. |
| syncLogs (WorkspaceConnectorSyncLog) โ inverse reference | to-many (WorkspaceConnectorSyncLog) | โช No | Inverse reference โ NOT declared as @OneToMany on WorkspaceConnector. WorkspaceConnectorSyncLog declares @ManyToOne(() => WorkspaceConnector, { deleteRule: 'cascade' }). Sync execution log rows emitted per sync run. CASCADE-delete: all log rows are deleted when the parent workspace_connector row is hard-deleted. |
| documentWorkspaceConnectors (DocumentWorkspaceConnector) โ inverse reference | to-many (DocumentWorkspaceConnector) | โช No | Inverse reference โ NOT declared as @OneToMany on WorkspaceConnector. Junction table tracking which documents were ingested by this connector, with direction discrimination (input vs output). Equivalent to the company/people/account/invoice/transaction junction tables; DocumentWorkspaceConnector declares @ManyToOne(() => WorkspaceConnector). |