Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): add direct_query_enabled toggle to data sources (#64685)

Daniel RC47196fa7be49
diff --git a/posthog/hogql/database/test/__snapshots__/test_database.ambr b/posthog/hogql/database/test/__snapshots__/test_database.ambr
index 48287ba3eca6..e3532377e505 100644
--- a/posthog/hogql/database/test/__snapshots__/test_database.ambr
+++ b/posthog/hogql/database/test/__snapshots__/test_database.ambr
@@ -277,6 +277,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -613,6 +614,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
index bc3162c37e44..ef39072d90fe 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
@@ -877,6 +877,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -1755,6 +1756,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -2629,6 +2631,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -3503,6 +3506,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -4381,6 +4385,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -5259,6 +5264,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -6137,6 +6143,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -6278,6 +6285,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -7298,6 +7306,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -8270,6 +8279,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -9297,6 +9307,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -10263,6 +10274,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -11000,6 +11012,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -11912,6 +11925,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -12848,6 +12862,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -13815,6 +13830,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -14519,6 +14535,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
@@ -14812,6 +14829,7 @@
"posthog_externaldatasource"."description",
"posthog_externaldatasource"."created_via",
"posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
"posthog_externaldatasource"."revenue_analytics_enabled",
"posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
"posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
diff --git a/products/data_warehouse/backend/api/external_data_source.py b/products/data_warehouse/backend/api/external_data_source.py
index 06249af83b33..fdef797e9edc 100644
--- a/products/data_warehouse/backend/api/external_data_source.py
+++ b/products/data_warehouse/backend/api/external_data_source.py
@@ -664,6 +664,13 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializer
"Ignored on update."
),
)
+ direct_query_enabled = serializers.BooleanField(
+ required=False,
+ help_text=(
+ "Whether this synced source is also live-queryable via direct connection. "
+ "Defaults to true for new sources; ignored for pure direct-query sources."
+ ),
+ )
class Meta:
model = ExternalDataSource
@@ -680,6 +687,7 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializer
"prefix",
"description",
"access_method",
+ "direct_query_enabled",
"engine",
"last_run_at",
"schemas",
@@ -1078,6 +1086,14 @@ class ExternalDataSourceCreateSerializer(serializers.Serializer):
default=ExternalDataSource.CreatedVia.API,
help_text="Where the request came from",
)
+ direct_query_enabled = serializers.BooleanField(
+ required=False,
+ default=True,
+ help_text=(
+ "Whether a synced source should also be live-queryable via direct connection. "
+ "Defaults to true; ignored for pure direct-query sources."
+ ),
+ )
class SourceSetupSerializer(serializers.Serializer):
@@ -1107,6 +1123,14 @@ class SourceSetupSerializer(serializers.Serializer):
description = serializers.CharField(
max_length=400, required=False, allow_null=True, allow_blank=True, help_text="Human-readable description."
)
+ direct_query_enabled = serializers.BooleanField(
+ required=False,
+ default=True,
+ help_text=(
+ "Whether a synced source should also be live-queryable via direct connection. "
+ "Defaults to true; ignored for pure direct-query sources."
+ ),
+ )
class SourceSetupWebhookSerializer(serializers.Serializer):
@@ -1335,6 +1359,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
description=serializer.validated_data.get("description"),
access_method=serializer.validated_data.get("access_method", ExternalDataSource.AccessMethod.WAREHOUSE),
created_via=serializer.validated_data.get("created_via", ExternalDataSource.CreatedVia.API),
+ direct_query_enabled=serializer.validated_data.get("direct_query_enabled", True),
)
def _create_external_data_source(
@@ -1347,6 +1372,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
description: str | None,
access_method: str,
created_via: str,
+ direct_query_enabled: bool = True,
skip_credential_validation: bool = False,
) -> Response:
# `skip_credential_validation` is set only by the `setup` action, which has already run the
@@ -1430,6 +1456,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
prefix=prefix,
description=description,
access_method=access_method,
+ direct_query_enabled=direct_query_enabled,
)
# CDC: gate per-source-type adapter availability up front so downstream blocks
@@ -2346,6 +2373,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
description=serializer.validated_data.get("description"),
access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
created_via=ExternalDataSource.CreatedVia.MCP,
+ direct_query_enabled=serializer.validated_data.get("direct_query_enabled", True),
skip_credential_validation=True,
)
# Stored credentials are single-use: once the source owns them (in job_inputs), drop the stash.
diff --git a/products/data_warehouse/backend/api/test/test_external_data_source.py b/products/data_warehouse/backend/api/test/test_external_data_source.py
index 5d90c3da5164..bac634eb61f7 100644
--- a/products/data_warehouse/backend/api/test/test_external_data_source.py
+++ b/products/data_warehouse/backend/api/test/test_external_data_source.py
@@ -379,6 +379,50 @@ class TestExternalDataSource(APIBaseTest):
assert source.created_via is None
assert source.description == "edited"
+ @parameterized.expand(
+ [
+ ("omitted_defaults_true", {}, True),
+ ("explicit_true", {"direct_query_enabled": True}, True),
+ ("explicit_false", {"direct_query_enabled": False}, False),
+ ]
+ )
+ @patch(
+ "posthog.temporal.data_imports.sources.stripe.source.StripeSource.validate_credentials",
+ return_value=(True, None),
+ )
+ def test_create_external_data_source_direct_query_enabled(self, _name, body, expected, _mock_validate):
+ response = self.client.post(
+ f"/api/environments/{self.team.pk}/external_data_sources/",
+ data={
+ "source_type": "Stripe",
+ **body,
+ "payload": {
+ "auth_method": {"selection": "api_key", "stripe_secret_key": "sk_test_123"},
+ "schemas": [
+ {"name": STRIPE_CUSTOMER_RESOURCE_NAME, "should_sync": True, "sync_type": "full_refresh"},
+ ],
+ },
+ },
+ )
+
+ assert response.status_code == 201, response.json()
+ source = ExternalDataSource.objects.get(id=response.json()["id"])
+ assert source.direct_query_enabled is expected
+
+ def test_patch_external_data_source_toggles_direct_query_enabled(self):
+ source = self._create_external_data_source()
+ assert source.direct_query_enabled is True
+
+ response = self.client.patch(
+ f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/",
+ data={"direct_query_enabled": False},
+ )
+
+ assert response.status_code == 200, response.json()
+ assert response.json()["direct_query_enabled"] is False
+ source.refresh_from_db()
+ assert source.direct_query_enabled is False
+
@patch(
"products.data_warehouse.backend.api.external_data_schema.external_data_workflow_exists",
return_value=False,
@@ -1643,6 +1687,7 @@ class TestExternalDataSource(APIBaseTest):
"prefix",
"description",
"access_method",
+ "direct_query_enabled",
"engine",
"last_run_at",
"schemas",
@@ -9011,6 +9056,26 @@ class TestExternalDataSourceSetup(APIBaseTest):
assert synced.exists()
assert all(s.sync_type in ("incremental", "append", "full_refresh") for s in synced)
+ @patch("products.data_warehouse.backend.api.external_data_source.ensure_person_join")
+ @patch("products.data_modeling.backend.models.datawarehouse_managed_viewset.DataWarehouseManagedViewSet.sync_views")
+ @patch(
+ "posthog.temporal.data_imports.sources.stripe.source.StripeSource.validate_credentials",
+ return_value=(True, None),
+ )
+ def test_setup_persists_direct_query_enabled_false(self, _mock_validate, _mock_sync_views, _mock_person_join):
+ response = self.client.post(
+ f"/api/environments/{self.team.pk}/external_data_sources/setup/",
+ data={
+ "source_type": "Stripe",
+ "direct_query_enabled": False,
+ "payload": {"auth_method": {"selection": "api_key", "stripe_secret_key": "sk_test_123"}},
+ },
+ )
+ assert response.status_code == status.HTTP_201_CREATED, response.json()
+
+ source = ExternalDataSource.objects.get(pk=response.json()["id"])
+ assert source.direct_query_enabled is False
+
def _create_stripe_webhook_template(self):
from products.cdp.backend.models.hog_function_template import HogFunctionTemplate
diff --git a/products/warehouse_sources/backend/migrations/0028_externaldatasource_direct_query_enabled.py b/products/warehouse_sources/backend/migrations/0028_externaldatasource_direct_query_enabled.py
new file mode 100644
index 000000000000..f8cabce870b7
--- /dev/null
+++ b/products/warehouse_sources/backend/migrations/0028_externaldatasource_direct_query_enabled.py
@@ -0,0 +1,17 @@
+# Generated by Django 5.2.14 on 2026-06-18 17:26
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("warehouse_sources", "0027_alter_externaldatasource_source_type_and_more"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="externaldatasource",
+ name="direct_query_enabled",
+ field=models.BooleanField(default=True),
+ ),
+ ]
diff --git a/products/warehouse_sources/backend/migrations/0029_backfill_externaldatasource_direct_query_enabled.py b/products/warehouse_sources/backend/migrations/0029_backfill_externaldatasource_direct_query_enabled.py
new file mode 100644
index 000000000000..7c708d855698
--- /dev/null
+++ b/products/warehouse_sources/backend/migrations/0029_backfill_externaldatasource_direct_query_enabled.py
@@ -0,0 +1,32 @@
+import time
+
+from django.db import migrations
+
+BATCH_SIZE = 2000
+
+
+def forwards(apps, schema_editor):
+ ExternalDataSource = apps.get_model("warehouse_sources", "ExternalDataSource")
+ # 0028 defaulted every row to True. Opt existing synced sources out so the capability gate only
+ # lights up sources a user explicitly enables; direct sources keep True. Batch so we never hold
+ # row locks across the whole table at once — updated rows fall out of the filter, advancing the loop.
+ while True:
+ batch_ids = list(
+ ExternalDataSource.objects.filter(access_method="warehouse", direct_query_enabled=True).values_list(
+ "id", flat=True
+ )[:BATCH_SIZE]
+ )
+ if not batch_ids:
+ break
+ ExternalDataSource.objects.filter(id__in=batch_ids).update(direct_query_enabled=False)
+ time.sleep(0.1)
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("warehouse_sources", "0028_externaldatasource_direct_query_enabled"),
+ ]
+
+ operations = [
+ migrations.RunPython(forwards, migrations.RunPython.noop, elidable=True),
+ ]
diff --git a/products/warehouse_sources/backend/migrations/max_migration.txt b/products/warehouse_sources/backend/migrations/max_migration.txt
index 817c37839bc0..9e13355851f0 100644
--- a/products/warehouse_sources/backend/migrations/max_migration.txt
+++ b/products/warehouse_sources/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0027_alter_externaldatasource_source_type_and_more
+0029_backfill_externaldatasource_direct_query_enabled
diff --git a/products/warehouse_sources/backend/models/external_data_source.py b/products/warehouse_sources/backend/models/external_data_source.py
index 7127e8ef18be..cb631c0ed740 100644
--- a/products/warehouse_sources/backend/models/external_data_source.py
+++ b/products/warehouse_sources/backend/models/external_data_source.py
@@ -64,6 +64,8 @@ class ExternalDataSource(ModelActivityMixin, CreatedMetaFields, UpdatedMetaField
# via the serializer; NULL on historical rows created before this field existed.
created_via = models.CharField(max_length=20, choices=CreatedVia, null=True, blank=True)
access_method = models.CharField(max_length=32, choices=AccessMethod, default=AccessMethod.WAREHOUSE)
+ # Lets a synced (warehouse) source also be live-queryable via direct connection; ignored for pure direct sources.
+ direct_query_enabled = models.BooleanField(default=True)
# DEPRECATED: Check inside `revenue_analytics_config` instead
revenue_analytics_enabled = models.BooleanField(default=False, blank=True, null=True)
diff --git a/products/warehouse_sources/backend/tests/test_migration_0028.py b/products/warehouse_sources/backend/tests/test_migration_0028.py
new file mode 100644
index 000000000000..a95b6f279074
--- /dev/null
+++ b/products/warehouse_sources/backend/tests/test_migration_0028.py
@@ -0,0 +1,49 @@
+from typing import Any
+
+from posthog.test.base import TestMigrations
+
+
+class BackfillDirectQueryEnabledMigrationTest(TestMigrations):
+ """0028 defaults every row to True. The backfill must opt existing synced (warehouse) sources out so
+ the direct-connect capability gate only lights up sources a user explicitly enables; direct sources
+ keep True.
+ """
+
+ migrate_from = "0028_externaldatasource_direct_query_enabled"
+ migrate_to = "0029_backfill_externaldatasource_direct_query_enabled"
+
+ @property
+ def app(self) -> str:
+ return "warehouse_sources"
+
+ def setUpBeforeMigration(self, apps: Any) -> None:
+ Organization = apps.get_model("posthog", "Organization")
+ Project = apps.get_model("posthog", "Project")
+ Team = apps.get_model("posthog", "Team")
+ ExternalDataSource = apps.get_model("warehouse_sources", "ExternalDataSource")
+ self.ExternalDataSource = ExternalDataSource
+
+ org = Organization.objects.create(name="Org")
+ project = Project.objects.create(id=999_999, organization=org, name="Proj")
+ team = Team.objects.create(organization=org, project=project, name="Team")
+
+ def make(access_method: str) -> str:
+ return ExternalDataSource.objects.create(
+ team=team,
+ source_id="src",
+ connection_id="conn",
+ status="Completed",
+ source_type="Postgres",
+ access_method=access_method,
+ ).id
+
+ self.warehouse_id = make("warehouse")
+ self.direct_id = make("direct")
+
+ def test_warehouse_source_is_disabled(self) -> None:
+ source = self.ExternalDataSource.objects.get(id=self.warehouse_id)
+ assert source.direct_query_enabled is False
+
+ def test_direct_source_stays_enabled(self) -> None:
+ source = self.ExternalDataSource.objects.get(id=self.direct_id)
+ assert source.direct_query_enabled is True
diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.ts
index 05d4e79e913e..4280460d33d9 100644
--- a/products/warehouse_sources/frontend/generated/api.schemas.ts
+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts
@@ -1701,6 +1701,8 @@ export interface ExternalDataSourceSerializersApi {
*/
description?: string | null
readonly access_method: AccessMethodEnumApi
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean
/** Backend engine detected for the direct connection.
*
* * `duckdb` - duckdb
@@ -2394,6 +2396,8 @@ export interface ExternalDataSourceCreateApi {
* * `api` - api
* * `mcp` - mcp */
created_via?: CreatedViaEnumApi
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean
}
export type PatchedExternalDataSourceSerializersApiSchemasItem = { [key: string]: unknown }
@@ -2429,6 +2433,8 @@ export interface PatchedExternalDataSourceSerializersApi {
*/
description?: string | null
readonly access_method?: AccessMethodEnumApi
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean
/** Backend engine detected for the direct connection.
*
* * `duckdb` - duckdb
@@ -3855,6 +3861,8 @@ export interface SourceSetupApi {
* @nullable
*/
description?: string | null
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean
}
export interface SourceSetupWebhookApi {
diff --git a/products/warehouse_sources/frontend/generated/api.zod.ts b/products/warehouse_sources/frontend/generated/api.zod.ts
index c55e1a935be4..d4d1e860641f 100644
--- a/products/warehouse_sources/frontend/generated/api.zod.ts
+++ b/products/warehouse_sources/frontend/generated/api.zod.ts
@@ -732,6 +732,7 @@ export const externalDataSourcesCreateBodyDescriptionMax = 400
export const externalDataSourcesCreateBodyAccessMethodDefault = `warehouse`
export const externalDataSourcesCreateBodyCreatedViaDefault = `api`
+export const externalDataSourcesCreateBodyDirectQueryEnabledDefault = true
export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
@@ -1393,6 +1394,12 @@ export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
.describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
.default(externalDataSourcesCreateBodyCreatedViaDefault)
.describe('Where the request came from\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ direct_query_enabled: zod
+ .boolean()
+ .default(externalDataSourcesCreateBodyDirectQueryEnabledDefault)
+ .describe(
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources.'
+ ),
})
/**
@@ -1417,6 +1424,12 @@ export const ExternalDataSourcesUpdateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesUpdateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesUpdateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1443,6 +1456,12 @@ export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ zod
account_id: zod.string().optional(),
prefix: zod.string().max(externalDataSourcesPartialUpdateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesPartialUpdateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1545,6 +1564,12 @@ export const ExternalDataSourcesCheckCdcPrerequisitesForSourceCreateBody = /* @_
.string()
.max(externalDataSourcesCheckCdcPrerequisitesForSourceCreateBodyDescriptionMax)
.nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1571,6 +1596,12 @@ export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesCreateWebhookCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesCreateWebhookCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1597,6 +1628,12 @@ export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesDeleteWebhookCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesDeleteWebhookCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1630,6 +1667,12 @@ export const ExternalDataSourcesDisableCdcCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesDisableCdcCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesDisableCdcCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1667,6 +1710,12 @@ export const ExternalDataSourcesEnableCdcCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesEnableCdcCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesEnableCdcCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1693,6 +1742,12 @@ export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesRefreshSchemasCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesRefreshSchemasCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1719,6 +1774,12 @@ export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesReloadCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesReloadCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1748,6 +1809,12 @@ export const ExternalDataSourcesRevenueAnalyticsConfigPartialUpdateBody = /* @__
.string()
.max(externalDataSourcesRevenueAnalyticsConfigPartialUpdateBodyDescriptionMax)
.nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1779,6 +1846,12 @@ export const ExternalDataSourcesUpdateCdcSettingsCreateBody = /* @__PURE__ */ zo
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesUpdateCdcSettingsCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesUpdateCdcSettingsCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1805,6 +1878,12 @@ export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesUpdateWebhookInputsCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesUpdateWebhookInputsCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -2472,6 +2551,8 @@ export const externalDataSourcesSetupCreateBodyPrefixMax = 100
export const externalDataSourcesSetupCreateBodyDescriptionMax = 400
+export const externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault = true
+
export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
.enum([
@@ -3127,6 +3208,12 @@ export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
.max(externalDataSourcesSetupCreateBodyDescriptionMax)
.nullish()
.describe('Human-readable description.'),
+ direct_query_enabled: zod
+ .boolean()
+ .default(externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault)
+ .describe(
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources.'
+ ),
})
/**
@@ -3151,6 +3238,12 @@ export const ExternalDataSourcesSourcePrefixCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesSourcePrefixCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesSourcePrefixCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index c707930ec38e..bfff7bf4d03a 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -21925,6 +21925,8 @@ export namespace Schemas {
* * `api` - api
* * `mcp` - mcp */
created_via?: CreatedViaEnum;
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean;
}
/**
@@ -21982,6 +21984,8 @@ export namespace Schemas {
*/
description?: string | null;
readonly access_method: AccessMethodEnum;
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean;
/** Backend engine detected for the direct connection.
*
* * `duckdb` - duckdb
@@ -35572,6 +35576,8 @@ export namespace Schemas {
*/
description?: string | null;
readonly access_method?: AccessMethodEnum;
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean;
/** Backend engine detected for the direct connection.
*
* * `duckdb` - duckdb
@@ -47148,6 +47154,8 @@ export namespace Schemas {
* @nullable
*/
description?: string | null;
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources. */
+ direct_query_enabled?: boolean;
}
export interface SourceSetupWebhook {
diff --git a/services/mcp/src/generated/warehouse_sources/api.ts b/services/mcp/src/generated/warehouse_sources/api.ts
index bb48b64e9076..741ab30dd1ad 100644
--- a/services/mcp/src/generated/warehouse_sources/api.ts
+++ b/services/mcp/src/generated/warehouse_sources/api.ts
@@ -628,6 +628,7 @@ export const externalDataSourcesCreateBodyPrefixMax = 100
export const externalDataSourcesCreateBodyDescriptionMax = 400
export const externalDataSourcesCreateBodyAccessMethodDefault = `warehouse`
+export const externalDataSourcesCreateBodyDirectQueryEnabledDefault = true
export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
@@ -1284,6 +1285,12 @@ export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
.describe(
"Connection mode: 'warehouse' (import) or 'direct' (live query).\n\n* `warehouse` - warehouse\n* `direct` - direct"
),
+ direct_query_enabled: zod
+ .boolean()
+ .default(externalDataSourcesCreateBodyDirectQueryEnabledDefault)
+ .describe(
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources.'
+ ),
})
/**
@@ -1329,6 +1336,12 @@ export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ zod
account_id: zod.string().optional(),
prefix: zod.string().max(externalDataSourcesPartialUpdateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesPartialUpdateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1376,6 +1389,12 @@ export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesCreateWebhookCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesCreateWebhookCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1411,6 +1430,12 @@ export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ zod
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesDeleteWebhookCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesDeleteWebhookCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1438,6 +1463,12 @@ export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ zod
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1464,6 +1495,12 @@ export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ zod
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1498,6 +1535,12 @@ export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */
account_id: zod.string(),
prefix: zod.string().max(externalDataSourcesUpdateWebhookInputsCreateBodyPrefixMax).nullish(),
description: zod.string().max(externalDataSourcesUpdateWebhookInputsCreateBodyDescriptionMax).nullish(),
+ direct_query_enabled: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.'
+ ),
job_inputs: zod.unknown().optional(),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1590,6 +1633,8 @@ export const externalDataSourcesSetupCreateBodyPrefixMax = 100
export const externalDataSourcesSetupCreateBodyDescriptionMax = 400
+export const externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault = true
+
export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
.enum([
@@ -2245,6 +2290,12 @@ export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
.max(externalDataSourcesSetupCreateBodyDescriptionMax)
.nullish()
.describe('Human-readable description.'),
+ direct_query_enabled: zod
+ .boolean()
+ .default(externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault)
+ .describe(
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources.'
+ ),
})
/**
diff --git a/services/mcp/src/tools/generated/warehouse_sources.ts b/services/mcp/src/tools/generated/warehouse_sources.ts
index d0e7b00e57e8..1180f40223b7 100644
--- a/services/mcp/src/tools/generated/warehouse_sources.ts
+++ b/services/mcp/src/tools/generated/warehouse_sources.ts
@@ -87,6 +87,9 @@ const dataWarehouseSourceSetup = (): ToolBase<typeof DataWarehouseSourceSetupSch
if (params.description !== undefined) {
body['description'] = params.description
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
const result = await context.api.request<Schemas.SourceSetupResponse>({
method: 'POST',
path: `/api/projects/${encodeURIComponent(String(projectId))}/external_data_sources/setup/`,
@@ -517,6 +520,9 @@ const externalDataSourcesCreate = (): ToolBase<
if (params.access_method !== undefined) {
body['access_method'] = params.access_method
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
body['created_via'] = 'mcp'
const result = await context.api.request<Schemas.ExternalDataSourceSerializers>({
method: 'POST',
@@ -555,6 +561,9 @@ const externalDataSourcesCreateWebhookCreate = (): ToolBase<
if (params.description !== undefined) {
body['description'] = params.description
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
if (params.job_inputs !== undefined) {
body['job_inputs'] = params.job_inputs
}
@@ -595,6 +604,9 @@ const externalDataSourcesDeleteWebhookCreate = (): ToolBase<
if (params.description !== undefined) {
body['description'] = params.description
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
if (params.job_inputs !== undefined) {
body['job_inputs'] = params.job_inputs
}
@@ -673,6 +685,9 @@ const externalDataSourcesPartialUpdate = (): ToolBase<
if (params.description !== undefined) {
body['description'] = params.description
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
if (params.job_inputs !== undefined) {
body['job_inputs'] = params.job_inputs
}
@@ -698,6 +713,9 @@ const externalDataSourcesRefreshSchemas = (): ToolBase<typeof ExternalDataSource
if (params.created_via !== undefined) {
body['created_via'] = params.created_via
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
const result = await context.api.request<unknown>({
method: 'POST',
path: `/api/projects/${encodeURIComponent(String(projectId))}/external_data_sources/${encodeURIComponent(String(params.id))}/refresh_schemas/`,
@@ -720,6 +738,9 @@ const externalDataSourcesReload = (): ToolBase<typeof ExternalDataSourcesReloadS
if (params.created_via !== undefined) {
body['created_via'] = params.created_via
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
const result = await context.api.request<unknown>({
method: 'POST',
path: `/api/projects/${encodeURIComponent(String(projectId))}/external_data_sources/${encodeURIComponent(String(params.id))}/reload/`,
@@ -775,6 +796,9 @@ const externalDataSourcesUpdateWebhookInputsCreate = (): ToolBase<
if (params.description !== undefined) {
body['description'] = params.description
}
+ if (params.direct_query_enabled !== undefined) {
+ body['direct_query_enabled'] = params.direct_query_enabled
+ }
if (params.job_inputs !== undefined) {
body['job_inputs'] = params.job_inputs
}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/data-warehouse-source-setup.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/data-warehouse-source-setup.json
index ae6eb5b8baca..d6e6196e2383 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/data-warehouse-source-setup.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/data-warehouse-source-setup.json
@@ -13,6 +13,11 @@
],
"description": "Human-readable description."
},
+ "direct_query_enabled": {
+ "default": true,
+ "description": "Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"payload": {
"additionalProperties": {},
"description": "Connection details as flat keys for the source_type (discover required fields with the wizard tool). Prefer references over raw secrets: pass {'credential_id': <id>} referencing the connection details the user stored via the connect-link page (discover ids with the stored_credentials endpoint) — they are merged in server-side and deleted once consumed. An already-connected OAuth integration can be passed via its id key instead (e.g. {'hubspot_integration_id': 123}). A 'schemas' array is NOT required — all discovered tables are enabled automatically with sensible sync defaults.",
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.json
index 9d1ee749b002..9a4cc9c94602 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create-webhook-create.json
@@ -31,6 +31,10 @@
}
]
},
+ "direct_query_enabled": {
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"id": {
"description": "A UUID string identifying this external data source.",
"type": "string"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create.json
index b646b21f32f9..dbf7a6172f9a 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-create.json
@@ -19,6 +19,11 @@
],
"description": "Human-readable description."
},
+ "direct_query_enabled": {
+ "default": true,
+ "description": "Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"payload": {
"additionalProperties": {},
"description": "Connection credentials for the source. Keys depend on source_type. For database sources: host, port, database, user, password, schema. For SaaS sources: api_key or OAuth fields. Use external-data-sources-wizard to see required fields per source type.",
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.json
index 9d1ee749b002..9a4cc9c94602 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-delete-webhook-create.json
@@ -31,6 +31,10 @@
}
]
},
+ "direct_query_enabled": {
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"id": {
"description": "A UUID string identifying this external data source.",
"type": "string"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.json
index 2aa7763e66a9..4f3af95ae3aa 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-partial-update.json
@@ -31,6 +31,10 @@
}
]
},
+ "direct_query_enabled": {
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"id": {
"description": "A UUID string identifying this external data source.",
"type": "string"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.json
index e41365059ed5..178a6f845287 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-refresh-schemas.json
@@ -14,6 +14,10 @@
],
"description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
+ "direct_query_enabled": {
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"id": {
"description": "A UUID string identifying this external data source.",
"type": "string"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.json
index e41365059ed5..178a6f845287 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-reload.json
@@ -14,6 +14,10 @@
],
"description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
+ "direct_query_enabled": {
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"id": {
"description": "A UUID string identifying this external data source.",
"type": "string"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.json
index 9d1ee749b002..9a4cc9c94602 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-sources-update-webhook-inputs-create.json
@@ -31,6 +31,10 @@
}
]
},
+ "direct_query_enabled": {
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to true for new sources; ignored for pure direct-query sources.",
+ "type": "boolean"
+ },
"id": {
"description": "A UUID string identifying this external data source.",
"type": "string"