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): live-query synced sources via schema metadata (#65595)

Daniel RCdd57b216084d
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 58a2dd67e76d..d0809791eeca 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -17208,6 +17208,7 @@
"type": "object"
},
"format": {
+ "description": "Absent for a dual-mode source's virtual tables, which have no synced S3 backing.",
"type": "string"
},
"id": {
@@ -17237,10 +17238,11 @@
"type": "string"
},
"url_pattern": {
+ "description": "Absent for a dual-mode source's virtual tables, which have no synced S3 backing.",
"type": "string"
}
},
- "required": ["fields", "format", "id", "name", "type", "url_pattern"],
+ "required": ["fields", "id", "name", "type"],
"type": "object"
},
"DatabaseSchemaEndpointTable": {
@@ -25274,7 +25276,7 @@
"additionalProperties": false,
"properties": {
"connectionId": {
- "description": "Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here.",
+ "description": "Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled.",
"type": "string"
},
"endPosition": {
@@ -25381,7 +25383,7 @@
"additionalProperties": false,
"properties": {
"connectionId": {
- "description": "Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here.",
+ "description": "Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled.",
"type": "string"
},
"debug": {
@@ -25526,7 +25528,7 @@
"additionalProperties": false,
"properties": {
"connectionId": {
- "description": "Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here.",
+ "description": "Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled.",
"type": "string"
},
"explain": {
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index dde80609d3c3..7868f3a614c7 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -589,7 +589,7 @@ export interface HogQLVariable {
export interface HogQLQuery extends DataNode<HogQLQueryResponse> {
kind: NodeKind.HogQLQuery
query: string
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string
/** Run the selected connection query directly without translating it through HogQL first */
sendRawQuery?: boolean
@@ -805,7 +805,7 @@ export interface HogQLMetadata extends DataNode<HogQLMetadataResponse> {
language: HogLanguage
/** Query to validate */
query: string
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string
/** Query within which "expr" and "template" are validated. Defaults to "select * from events" */
sourceQuery?: AnyDataNode
@@ -825,7 +825,7 @@ export interface HogQLAutocomplete extends DataNode<HogQLAutocompleteResponse> {
language: HogLanguage
/** Query to validate */
query: string
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string
/** Query in whose context to validate. */
sourceQuery?: AnyDataNode
@@ -5049,8 +5049,10 @@ export interface DatabaseSchemaSystemTable extends DatabaseSchemaTableCommon {
export interface DatabaseSchemaDataWarehouseTable extends DatabaseSchemaTableCommon {
type: 'data_warehouse'
- format: string
- url_pattern: string
+ /** Absent for a dual-mode source's virtual tables, which have no synced S3 backing. */
+ format?: string
+ /** Absent for a dual-mode source's virtual tables, which have no synced S3 backing. */
+ url_pattern?: string
schema?: DatabaseSchemaSchema
source?: DatabaseSchemaSource
/** Alternate names the table is queryable by (e.g. the flat underscore form), in addition to `name`. */
diff --git a/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx b/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx
index 30b5e6e93978..00c42c9a0772 100644
--- a/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx
@@ -1038,9 +1038,9 @@ const createSourceFolderNode = (
type={
sourceType === 'Self-managed' && (tables.length > 0 || matches.length > 0)
? mapUrlToProvider(
- tables.length > 0
+ (tables.length > 0
? (tables[0] as DatabaseSchemaDataWarehouseTable).url_pattern
- : (matches[0][0] as DatabaseSchemaDataWarehouseTable).url_pattern
+ : (matches[0][0] as DatabaseSchemaDataWarehouseTable).url_pattern) ?? ''
)
: sourceType
}
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.ts
index e5f5969cb078..411b59ab7da8 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.ts
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.ts
@@ -501,6 +501,7 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([
externalTables.push({
...table,
name: table.name,
+ url_pattern: table.url_pattern || '',
source_type: table.source?.source_type || mapUrlToProvider(table.url_pattern),
source_map_id: table.schema?.id || table.source?.id || table.id,
source_prefix: table.source?.prefix || '',
diff --git a/posthog/hogql/database/database.py b/posthog/hogql/database/database.py
index e69a0c763ce6..53eab76e9db7 100644
--- a/posthog/hogql/database/database.py
+++ b/posthog/hogql/database/database.py
@@ -165,6 +165,7 @@ from products.warehouse_sources.backend.facade.models import (
ExternalDataSchema,
ExternalDataSource,
)
+from products.warehouse_sources.backend.facade.types import ExternalDataSourceType
# posthog.schema (the pydantic models) is runtime-imported inside serialize()/serialize_fields()
# so it stays off django.setup(), where this module loads via the warehouse/data-modeling models.
@@ -225,6 +226,10 @@ class HogQLDatabaseSources:
data_warehouse_joins: list["DataWarehouseJoin"]
# dataWarehouseEventsModifiers path: saved query per modifier table name (None if no matching row).
event_modifier_saved_queries: dict[str, Optional["DataWarehouseSavedQuery"]]
+ # Dual-mode: a synced (warehouse) source queried live via connection_id. Its physical rows are
+ # synced S3 copies, so the build derives virtual DirectSQLTables from these schema rows instead.
+ virtual_source: Optional["ExternalDataSource"] = None
+ virtual_schemas: list["ExternalDataSchema"] = dataclasses.field(default_factory=list)
type DatabaseSchemaTable = (
@@ -993,6 +998,69 @@ class Database(BaseModel):
self._serialization_errors[table_key] = str(e)
continue
+ # Dual-mode: a synced source queried live has no physical direct rows — the loop above yields
+ # nothing for it — so emit one entry per schema row backing a virtual table.
+ if self._is_direct_query():
+ # Function-local: keeps the direct-SQL driver imports off the django.setup() path.
+ from posthog.hogql.direct_sql.capability import is_direct_capable # noqa: PLC0415
+
+ connection_id = self._connection_id
+ assert connection_id is not None # guaranteed by _is_direct_query()
+ dual_source = (
+ ExternalDataSource.objects.filter(team_id=context.team_id, id=connection_id)
+ .exclude(deleted=True)
+ .select_related(None)
+ .defer("job_inputs")
+ .first()
+ )
+ if (
+ dual_source is not None
+ and dual_source.access_method != ExternalDataSource.AccessMethod.DIRECT
+ and is_direct_capable(dual_source)
+ ):
+ latest_completed_job = (
+ dual_source.jobs.filter(team_id=context.team_id, status="Completed").order_by("-created_at").first()
+ )
+ virtual_source = DatabaseSchemaSource(
+ id=str(dual_source.id),
+ status=dual_source.status,
+ source_type=dual_source.source_type,
+ access_method=dual_source.access_method,
+ prefix=dual_source.prefix or "",
+ last_synced_at=str(latest_completed_job.created_at) if latest_completed_job else None,
+ )
+ # Same selection as the build path (eligible_direct_query_schemas), so the catalog
+ # and the built tables can't drift.
+ from products.data_warehouse.backend.facade.direct_query import ( # noqa: PLC0415
+ eligible_direct_query_schemas,
+ )
+
+ for schema_row in eligible_direct_query_schemas(context.team_id, connection_id):
+ table_key = schema_row.name
+ if include_only and table_key not in include_only:
+ continue
+ try:
+ table = self.get_table(table_key)
+ except QueryError:
+ # Not built for this connection (unusable columns, or access-denied).
+ continue
+
+ fields = serialize_fields(table.fields, context, table_key.split("."), table_type="external")
+ tables[table_key] = DatabaseSchemaDataWarehouseTable(
+ fields={field.name: field for field in fields},
+ id=str(schema_row.id),
+ name=table_key,
+ schema=DatabaseSchemaSchema(
+ id=str(schema_row.id),
+ name=schema_row.name,
+ should_sync=schema_row.should_sync,
+ incremental=schema_row.is_incremental or schema_row.is_webhook,
+ status=schema_row.status,
+ last_synced_at=str(schema_row.last_synced_at) if schema_row.last_synced_at else None,
+ ),
+ source=virtual_source,
+ )
+
# Fetch all views in a single query
all_views = (
DataWarehouseSavedQuery.objects.select_related("table")
@@ -1151,20 +1219,48 @@ class Database(BaseModel):
)
with timings.measure("database", emit_span=True):
+ # Function-local: keeps the direct-SQL driver imports off the django.setup() path.
+ from posthog.hogql.direct_sql.capability import is_direct_capable # noqa: PLC0415
+
direct_connection_metadata: dict[str, Any] | None = None
+ # Dual-mode: a synced source queried live builds virtual tables from schema metadata.
+ virtual_source: ExternalDataSource | None = None
if connection_id is not None:
direct_source = (
ExternalDataSource.objects.filter(
team_id=team.pk,
id=connection_id,
- access_method=ExternalDataSource.AccessMethod.DIRECT,
)
+ .exclude(deleted=True)
.select_related(None)
- .only("connection_metadata")
+ # job_inputs stays deferred (Fernet decrypt); only the virtual builder reads it.
+ .defer("job_inputs")
.first()
)
- if direct_source is not None:
+ if direct_source is not None and (
+ direct_source.access_method == ExternalDataSource.AccessMethod.DIRECT
+ or is_direct_capable(direct_source)
+ ):
direct_connection_metadata = direct_source.connection_metadata
+ # A capable non-DIRECT (synced) source drives the dual-mode virtual-table path.
+ if direct_source.access_method != ExternalDataSource.AccessMethod.DIRECT:
+ virtual_source = direct_source
+ # Dual-mode live queries run under warehouse table-level access control. The
+ # introspected `available_functions` (scalar passthrough, e.g. query_to_xml) and
+ # `available_table_functions` (FROM func() via OpaqueFunctionCallTable) both let a
+ # user execute arbitrary SQL against the upstream DB, bypassing the should_sync /
+ # row-filter / column / warehouse-object checks enforced when virtual tables are
+ # built. Drop both so only built-in safe functions pass through; DIRECT sources
+ # (full DB access by design) keep introspected passthrough.
+ introspected_function_keys = {"available_functions", "available_table_functions"}
+ if isinstance(direct_connection_metadata, dict) and (
+ introspected_function_keys & direct_connection_metadata.keys()
+ ):
+ direct_connection_metadata = {
+ key: value
+ for key, value in direct_connection_metadata.items()
+ if key not in introspected_function_keys
+ }
with timings.measure("filter_system_tables_for_user", emit_span=True):
# System-table access control always applies; Only warehouse table/view support bypass.
@@ -1246,44 +1342,62 @@ class Database(BaseModel):
if sq.table_id is not None and sq.table is not None and sq.folder_path in sq.table.url_pattern
}
+ virtual_schemas: list[ExternalDataSchema] = []
with timings.measure("data_warehouse_tables", emit_span=True):
- with timings.measure("select", emit_span=True):
- tables_query = (
- # `queryable()` drops soft-deleted tables and orphans left by a soft-deleted
- # source, so an orphan can't shadow the live table sharing its name.
- DataWarehouseTable.raw_objects.filter(team_id=team.pk)
- .queryable()
- # created_by is hydrated for the warehouse access-control creator check
- .select_related("created_by")
- # credential/external_data_source attached in bulk below, not joined per row; the
- # access_method filter still joins the source for its WHERE without hydrating it.
- # Deterministic tiebreak when two live tables share a name: newest wins, since
- # name collisions resolve first-come-first-served when added to the table tree.
- .order_by("-created_at")
- )
- if backing_table_ids:
- tables_query = tables_query.exclude(id__in=backing_table_ids)
- if is_direct_query:
- tables_query = tables_query.filter(external_data_source_id=connection_id)
- else:
- tables_query = tables_query.exclude(
- external_data_source__access_method=ExternalDataSource.AccessMethod.DIRECT
+ if virtual_source is not None:
+ # Dual-mode: the source's physical rows are synced S3 copies, deliberately excluded
+ # from the direct catalog. The build derives virtual tables from schema rows instead.
+ warehouse_tables: list[DataWarehouseTable] = []
+ # The virtual builder reads job_inputs (deferred above); hydrate it here so the
+ # build phase stays query-free.
+ _ = virtual_source.job_inputs
+ with timings.measure("select_virtual_schemas", emit_span=True):
+ # Function-local: keeps the direct-SQL driver imports off the django.setup() path.
+ from products.data_warehouse.backend.facade.direct_query import ( # noqa: PLC0415
+ eligible_direct_query_schemas,
)
- warehouse_tables: list[DataWarehouseTable] = list(tables_query)
- # Direct-query mode builds the direct-postgres tables, which read source.job_inputs, so
- # keep it hydrated there instead of lazily reloading it per table.
- _attach_external_data_sources(warehouse_tables, team_id=team.pk, defer_job_inputs=not is_direct_query)
- _preload_active_external_data_schemas(warehouse_tables)
- if is_direct_query:
- warehouse_tables = [
- table
- for table in warehouse_tables
- if _should_include_connection_table(
- table,
- connection_id=cast(str, connection_id),
+ virtual_schemas = eligible_direct_query_schemas(team.pk, cast(str, connection_id))
+ else:
+ with timings.measure("select", emit_span=True):
+ tables_query = (
+ # `queryable()` drops soft-deleted tables and orphans left by a soft-deleted
+ # source, so an orphan can't shadow the live table sharing its name.
+ DataWarehouseTable.raw_objects.filter(team_id=team.pk)
+ .queryable()
+ # created_by is hydrated for the warehouse access-control creator check
+ .select_related("created_by")
+ # credential/external_data_source attached in bulk below, not joined per row; the
+ # access_method filter still joins the source for its WHERE without hydrating it.
+ # Deterministic tiebreak when two live tables share a name: newest wins, since
+ # name collisions resolve first-come-first-served when added to the table tree.
+ .order_by("-created_at")
+ )
+ if backing_table_ids:
+ tables_query = tables_query.exclude(id__in=backing_table_ids)
+ if is_direct_query:
+ tables_query = tables_query.filter(external_data_source_id=connection_id)
+ else:
+ tables_query = tables_query.exclude(
+ external_data_source__access_method=ExternalDataSource.AccessMethod.DIRECT
)
- ]
+
+ warehouse_tables = list(tables_query)
+ # Direct-query mode builds the direct-postgres tables, which read source.job_inputs, so
+ # keep it hydrated there instead of lazily reloading it per table.
+ _attach_external_data_sources(
+ warehouse_tables, team_id=team.pk, defer_job_inputs=not is_direct_query
+ )
+ _preload_active_external_data_schemas(warehouse_tables)
+ if is_direct_query:
+ warehouse_tables = [
+ table
+ for table in warehouse_tables
+ if _should_include_connection_table(
+ table,
+ connection_id=cast(str, connection_id),
+ )
+ ]
with timings.measure("data_warehouse_joins", emit_span=True):
data_warehouse_joins = list(DataWarehouseJoin.objects.filter(team_id=team.pk).exclude(deleted=True))
@@ -1340,6 +1454,8 @@ class Database(BaseModel):
warehouse_tables=warehouse_tables,
data_warehouse_joins=data_warehouse_joins,
event_modifier_saved_queries=event_modifier_saved_queries,
+ virtual_source=virtual_source,
+ virtual_schemas=virtual_schemas,
)
@staticmethod
@@ -1629,6 +1745,48 @@ class Database(BaseModel):
warehouse_tables_to_process.append((primary_table, table))
+ if sources.virtual_source is not None and sources.virtual_schemas:
+ # Function-local: the builder pulls the engine helper modules, kept off django.setup().
+ from products.data_warehouse.backend.facade.direct_query import ( # noqa: PLC0415
+ build_direct_table_for_schema,
+ )
+
+ virtual_source = sources.virtual_source
+ with timings.measure("build_virtual_tables", emit_span=True):
+ for schema_row in sources.virtual_schemas:
+ # Warehouse access control is granted on the synced table row. A schema row
+ # without one yet (discovered but not synced) has nothing to check permission
+ # against, so fail closed and deny it rather than let it slip through unchecked.
+ if (
+ sources.is_hogql_warehouse_access_control_enabled
+ and not sources.bypass_warehouse_access_control
+ and (schema_row.table is None or database._is_warehouse_table_denied(schema_row.table))
+ ):
+ continue
+
+ virtual_table = build_direct_table_for_schema(schema_row, virtual_source)
+ if virtual_table is None:
+ continue
+
+ if virtual_table.fields.get("properties") is None:
+ virtual_table.fields["properties"] = WarehousePropertiesVirtualTable(
+ fields=virtual_table.fields, parent_table=virtual_table, hidden=True
+ )
+
+ table_key = schema_row.name
+ warehouse_tables.add_child(
+ TableNode.create_nested_for_chain(
+ table_key.split("."),
+ virtual_table,
+ # Snowflake resolves identifiers case-insensitively; the model's
+ # is_direct_snowflake prop is False for synced sources, so key off type.
+ case_insensitive=(virtual_source.source_type == ExternalDataSourceType.SNOWFLAKE),
+ ),
+ table_conflict_mode="override",
+ )
+ virtual_table.name = table_key
+ database._direct_access_warehouse_table_names.add(table_key)
+
db_span.set_attribute("warehouse_table_count", len(sources.warehouse_tables))
# Index warehouse table models by name, newest wins, mirroring the eager path's `.latest()`.
diff --git a/posthog/hogql/database/test/test_database.py b/posthog/hogql/database/test/test_database.py
index 61ccc370fa58..5efcdcf85e0f 100644
--- a/posthog/hogql/database/test/test_database.py
+++ b/posthog/hogql/database/test/test_database.py
@@ -37,7 +37,9 @@ from posthog.hogql.database.database import (
build_database_root_node,
get_data_warehouse_table_name,
)
+from posthog.hogql.database.direct_mysql_table import DirectMySQLTable
from posthog.hogql.database.direct_postgres_table import DirectPostgresTable
+from posthog.hogql.database.direct_redshift_table import DirectRedshiftTable
from posthog.hogql.database.direct_snowflake_table import DirectSnowflakeTable
from posthog.hogql.database.lazy_join_tags import FOREIGN_KEY
from posthog.hogql.database.models import (
@@ -1064,6 +1066,296 @@ class TestDatabase(BaseTest, QueryMatchingTest):
assert db.has_table("accounts")
assert not db.has_table("ACCOUNTS")
+ def _create_dual_mode_postgres_source(self, *, direct_query_enabled: bool = True) -> ExternalDataSource:
+ return ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="synced_pg_source",
+ source_type=ExternalDataSourceType.POSTGRES,
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=direct_query_enabled,
+ prefix="pg",
+ job_inputs={"schema": "public"},
+ )
+
+ def _create_dual_mode_schema_row(
+ self,
+ source: ExternalDataSource,
+ name: str,
+ *,
+ table: DataWarehouseTable | None = None,
+ source_schema: str = "public",
+ source_table_name: str | None = None,
+ ) -> ExternalDataSchema:
+ return ExternalDataSchema.objects.create(
+ team=self.team,
+ name=name,
+ source=source,
+ table=table,
+ should_sync=True,
+ sync_type_config={
+ "schema_metadata": {
+ "columns": [
+ {"name": "id", "data_type": "integer", "is_nullable": False},
+ {"name": "email", "data_type": "text", "is_nullable": True},
+ ],
+ "source_schema": source_schema,
+ "source_table_name": source_table_name or name.split(".")[-1],
+ }
+ },
+ )
+
+ def test_dual_mode_database_builds_virtual_tables_from_schema_metadata(self):
+ credential = DataWarehouseCredential.objects.create(team=self.team, access_key="k", access_secret="s")
+ source = self._create_dual_mode_postgres_source()
+ synced_table = DataWarehouseTable.objects.create(
+ name="pg_users",
+ format="Parquet",
+ team=self.team,
+ credential=credential,
+ external_data_source=source,
+ url_pattern="s3://bucket/users/*",
+ columns={"id": {"clickhouse": "Int64", "hogql": "IntegerDatabaseField"}},
+ )
+ self._create_dual_mode_schema_row(source, "public.users", table=synced_table)
+ # Discovered before metadata persistence shipped — no columns to build from.
+ ExternalDataSchema.objects.create(
+ team=self.team, name="public.legacy", source=source, should_sync=True, sync_type_config={}
+ )
+
+ sources = Database._fetch_sources(team=self.team, connection_id=str(source.id))
+ # The virtual build must honor the fetch/build split: all I/O happens up front.
+ with self.assertNumQueries(0):
+ database = Database._build_from_sources(sources)
+
+ virtual_table = database.get_table("public.users")
+ assert isinstance(virtual_table, DirectPostgresTable)
+ assert virtual_table.postgres_schema == "public"
+ assert virtual_table.postgres_table_name == "users"
+ assert virtual_table.external_data_source_id == str(source.id)
+ id_field = virtual_table.fields["id"]
+ assert isinstance(id_field, DatabaseField)
+ assert id_field.nullable is False
+ email_field = virtual_table.fields["email"]
+ assert isinstance(email_field, DatabaseField)
+ assert email_field.nullable is True
+ assert "properties" in virtual_table.fields
+ # The synced S3 copy must not leak into the direct catalog; metadata-less rows are skipped.
+ assert not database.has_table("pg_users")
+ assert not database.has_table("public.legacy")
+ assert database.get_all_table_names() == ["public.users"]
+
+ def test_dual_mode_database_disabled_toggle_yields_empty_catalog(self):
+ source = self._create_dual_mode_postgres_source(direct_query_enabled=False)
+ self._create_dual_mode_schema_row(source, "public.users")
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+
+ assert not database.has_table("public.users")
+ assert database.get_warehouse_table_names() == []
+
+ def test_dual_mode_database_excludes_row_filtered_schemas(self):
+ # A synced schema's row_filters restrict which rows sync; the live direct query can't
+ # reproduce that filter, so exposing the table would let a user read unsynced rows. It
+ # must be absent from both the build catalog and the serialized schema.
+ source = self._create_dual_mode_postgres_source()
+ self._create_dual_mode_schema_row(source, "public.users")
+ filtered = self._create_dual_mode_schema_row(source, "public.orders")
+ filtered.row_filters = [{"field": "status", "operator": "exact", "value": "shipped"}]
+ filtered.save(update_fields=["row_filters"])
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+
+ assert database.has_table("public.users")
+ assert not database.has_table("public.orders")
+ serialized = database.serialize(HogQLContext(team_id=self.team.pk, database=database))
+ assert set(serialized.keys()) == {"public.users"}
+
+ def test_dual_mode_database_builds_mysql_virtual_tables(self):
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="synced_mysql_source",
+ source_type=ExternalDataSourceType.MYSQL,
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ prefix="shop",
+ job_inputs={"schema": "shop"},
+ )
+ ExternalDataSchema.objects.create(
+ team=self.team,
+ name="orders",
+ source=source,
+ should_sync=True,
+ sync_type_config={
+ "schema_metadata": {
+ "columns": [{"name": "id", "data_type": "bigint", "is_nullable": False}],
+ "source_schema": "shop",
+ "source_table_name": "orders",
+ }
+ },
+ )
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+
+ virtual_table = database.get_table("orders")
+ assert isinstance(virtual_table, DirectMySQLTable)
+ assert virtual_table.mysql_schema == "shop"
+ assert virtual_table.mysql_table_name == "orders"
+
+ def test_dual_mode_database_builds_redshift_virtual_tables(self):
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="synced_redshift_source",
+ source_type=ExternalDataSourceType.REDSHIFT,
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ prefix="rs",
+ job_inputs={"database": "dev", "schema": "public"},
+ )
+ ExternalDataSchema.objects.create(
+ team=self.team,
+ name="public.orders",
+ source=source,
+ should_sync=True,
+ sync_type_config={
+ "schema_metadata": {
+ "columns": [{"name": "id", "data_type": "integer", "is_nullable": False}],
+ "source_schema": "public",
+ "source_table_name": "orders",
+ }
+ },
+ )
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+
+ virtual_table = database.get_table("public.orders")
+ assert isinstance(virtual_table, DirectRedshiftTable)
+ assert virtual_table.postgres_schema == "public"
+ assert virtual_table.postgres_table_name == "orders"
+ assert virtual_table.postgres_catalog == "dev"
+
+ def test_dual_mode_database_resolves_snowflake_case_insensitively(self):
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="synced_snowflake_source",
+ source_type=ExternalDataSourceType.SNOWFLAKE,
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ prefix="snow",
+ job_inputs={"database": "DB", "schema": ""},
+ )
+ ExternalDataSchema.objects.create(
+ team=self.team,
+ name="TPCH_SF1.NATION",
+ source=source,
+ should_sync=True,
+ sync_type_config={
+ "schema_metadata": {
+ "columns": [{"name": "N_NAME", "data_type": "text", "is_nullable": False}],
+ "source_schema": "TPCH_SF1",
+ "source_table_name": "NATION",
+ }
+ },
+ )
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+
+ canonical = database.get_table("TPCH_SF1.NATION")
+ assert isinstance(canonical, DirectSnowflakeTable)
+ assert canonical.snowflake_catalog == "DB"
+ # Snowflake folds unquoted identifiers, and the model's is_direct_snowflake prop is False
+ # for a synced source — this pins the case-insensitive flag keying off source_type instead.
+ resolved = database.get_table("tpch_sf1.nation")
+ assert isinstance(resolved, DirectSnowflakeTable)
+
+ def test_dual_mode_database_serializes_virtual_tables_from_schema_rows(self):
+ source = self._create_dual_mode_postgres_source()
+ schema_row = self._create_dual_mode_schema_row(source, "public.users")
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+ serialized = database.serialize(HogQLContext(team_id=self.team.pk, database=database))
+
+ # Only the virtual entries serialize in dual mode — no posthog/system tables, no S3 rows.
+ assert list(serialized.keys()) == ["public.users"]
+ entry = serialized["public.users"]
+ assert isinstance(entry, DatabaseSchemaDataWarehouseTable)
+ assert entry.id == str(schema_row.id)
+ assert entry.format is None
+ assert entry.url_pattern is None
+ assert {"id", "email"} <= set(entry.fields.keys())
+ assert entry.schema_ is not None
+ assert entry.schema_.id == str(schema_row.id)
+ assert entry.source is not None
+ assert entry.source.access_method == "warehouse"
+ assert entry.source.id == str(source.id)
+
+ def test_dual_mode_database_applies_warehouse_access_control(self):
+ credential = DataWarehouseCredential.objects.create(team=self.team, access_key="k", access_secret="s")
+ source = self._create_dual_mode_postgres_source()
+ synced_table = DataWarehouseTable.objects.create(
+ name="pg_users",
+ format="Parquet",
+ team=self.team,
+ credential=credential,
+ external_data_source=source,
+ url_pattern="s3://bucket/users/*",
+ columns={"id": {"clickhouse": "Int64", "hogql": "IntegerDatabaseField"}},
+ )
+ self._create_dual_mode_schema_row(source, "public.users", table=synced_table)
+ self._create_dual_mode_schema_row(source, "public.events", source_table_name="events")
+
+ sources = Database._fetch_sources(team=self.team, connection_id=str(source.id))
+ sources.is_hogql_warehouse_access_control_enabled = True
+ # Userless AC fails closed: any schema row with a backing synced table is denied, and a
+ # row without one (nothing to check permission against) is denied too.
+ database = Database._build_from_sources(sources)
+
+ assert not database.has_table("public.users")
+ assert not database.has_table("public.events")
+
+ def test_dual_mode_strips_introspected_function_passthrough(self):
+ # `available_functions` (scalar passthrough, e.g. query_to_xml) and `available_table_functions`
+ # (FROM func()) both let a query execute arbitrary SQL on the upstream DB. A synced source runs
+ # under warehouse table-level access control, so exposing either would bypass those checks —
+ # both must be dropped from the dual-mode context while other metadata is preserved.
+ source = self._create_dual_mode_postgres_source()
+ source.connection_metadata = {
+ "engine": "postgres",
+ "database": "db",
+ "available_functions": ["query_to_xml"],
+ "available_table_functions": ["some_set_returning_fn"],
+ }
+ source.save(update_fields=["connection_metadata"])
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+
+ assert database._direct_connection_metadata is not None
+ assert "available_functions" not in database._direct_connection_metadata
+ assert "available_table_functions" not in database._direct_connection_metadata
+ assert database._direct_connection_metadata.get("engine") == "postgres"
+
+ def test_direct_source_keeps_introspected_function_passthrough(self):
+ # A DIRECT source is the user's own connected DB (full access by design), so introspected
+ # passthrough is not a privilege escalation and stays available.
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="direct_pg_fn_source",
+ source_type=ExternalDataSourceType.POSTGRES,
+ access_method=ExternalDataSource.AccessMethod.DIRECT,
+ job_inputs={"schema": "public"},
+ connection_metadata={
+ "engine": "postgres",
+ "database": "db",
+ "available_functions": ["query_to_xml"],
+ "available_table_functions": ["some_set_returning_fn"],
+ },
+ )
+
+ database = Database.create_for(team=self.team, connection_id=str(source.id))
+
+ assert database._direct_connection_metadata is not None
+ assert database._direct_connection_metadata.get("available_functions") == ["query_to_xml"]
+ assert database._direct_connection_metadata.get("available_table_functions") == ["some_set_returning_fn"]
+
@patch("posthog.hogql.query.sync_execute", return_value=([], []))
def test_build_from_sources_raises_when_modifier_table_has_no_backing_row(self, patch_execute):
# A dataWarehouseEventsModifier whose table resolves to a node with no backing row must fail
diff --git a/posthog/hogql/direct_connection.py b/posthog/hogql/direct_connection.py
index e96cb5355308..e1bb9a4d34ea 100644
--- a/posthog/hogql/direct_connection.py
+++ b/posthog/hogql/direct_connection.py
@@ -16,13 +16,13 @@ if TYPE_CHECKING:
INVALID_CONNECTION_ID_ERROR = (
- "Invalid connectionId: not a direct external data source (access_method='direct') in this team. "
- "Warehouse import sources are not valid here."
+ "Invalid connectionId: no direct-query-capable data source with this id in this team, "
+ "or you don't have access to it."
)
def get_direct_connection_source(
- team: "Team", connection_id: str | None, *, user: Optional["User"] = None
+ team: "Team", connection_id: str | None, *, user: Optional["User"] = None, require_pure_direct: bool = False
) -> ExternalDataSource | None:
if not connection_id:
return None
@@ -32,16 +32,25 @@ def get_direct_connection_source(
except ValueError:
return None
+ # Function-local: keeps the direct-SQL driver imports off the django.setup() path (startup-import-budget).
+ from posthog.hogql.direct_sql.capability import is_direct_capable # noqa: PLC0415
+
source = (
ExternalDataSource.objects.filter(
team_id=team.pk,
id=source_uuid,
- access_method=ExternalDataSource.AccessMethod.DIRECT,
)
.exclude(deleted=True)
.first()
)
- if source is None:
+ if source is None or not is_direct_capable(source):
+ return None
+
+ # Synced (warehouse) sources only expose their `should_sync` catalog — raw SQL bypasses that
+ # boundary and reads any upstream table, so raw queries are pure-direct only. Pure-direct
+ # sources have no restricted catalog to bypass; the whole external database is the intended
+ # surface.
+ if require_pure_direct and source.access_method != ExternalDataSource.AccessMethod.DIRECT:
return None
if user is not None and not UserAccessControl(user=user, team=team).check_access_level_for_object(
@@ -58,8 +67,9 @@ def get_direct_connection_source_none_or_raise(
*,
user: Optional["User"] = None,
error_factory: Callable[[str], Exception],
+ require_pure_direct: bool = False,
) -> ExternalDataSource | None:
- source = get_direct_connection_source(team, connection_id, user=user)
+ source = get_direct_connection_source(team, connection_id, user=user, require_pure_direct=require_pure_direct)
if connection_id and source is None:
raise error_factory(INVALID_CONNECTION_ID_ERROR)
return source
diff --git a/posthog/hogql/direct_sql/capability.py b/posthog/hogql/direct_sql/capability.py
index e3c3c27a5132..1c28931c833d 100644
--- a/posthog/hogql/direct_sql/capability.py
+++ b/posthog/hogql/direct_sql/capability.py
@@ -18,3 +18,14 @@ def is_direct_capable(source: ExternalDataSource) -> bool:
if source.access_method == ExternalDataSource.AccessMethod.DIRECT:
return True
return source.direct_query_enabled
+
+
+def direct_supports_hogql(source: ExternalDataSource) -> bool:
+ """Whether HogQL compiles for this source's direct engine (False means raw SQL only)."""
+ if source.direct_engine is None:
+ return False
+ # Function-local: the registry is populated by the package root, which pulls the drivers.
+ from posthog.hogql.direct_sql.registry import get_adapter # noqa: PLC0415
+
+ adapter = get_adapter(source.direct_engine)
+ return adapter is not None and adapter.dialect is not None
diff --git a/posthog/hogql/direct_sql/mysql_adapter.py b/posthog/hogql/direct_sql/mysql_adapter.py
index 3d6f4015cf1d..e7eba394646a 100644
--- a/posthog/hogql/direct_sql/mysql_adapter.py
+++ b/posthog/hogql/direct_sql/mysql_adapter.py
@@ -9,6 +9,7 @@ from sqlparse.sql import Statement
from posthog.hogql.constants import HogQLDialect
from posthog.hogql.direct_sql.adapter import DirectQueryRequest, DirectQueryResult
+from posthog.hogql.direct_sql.capability import is_direct_capable
from posthog.hogql.direct_sql.raw_sql import ensure_single_direct_statement
from posthog.hogql.errors import ExposedHogQLError
@@ -122,7 +123,8 @@ class MySQLAdapter:
from products.warehouse_sources.backend.facade.source_management import MySQLSource, SourceRegistry
from products.warehouse_sources.backend.facade.types import ExternalDataSourceType
- if not source.is_direct_mysql:
+ # Capability, not access_method: a synced source with the direct-query toggle on is valid too.
+ if not (is_direct_capable(source) and source.direct_engine == self.engine):
raise ExposedHogQLError("Invalid direct MySQL connection.")
mysql_source = cast(MySQLSource, SourceRegistry.get_source(ExternalDataSourceType.MYSQL))
diff --git a/posthog/hogql/direct_sql/postgres_adapter.py b/posthog/hogql/direct_sql/postgres_adapter.py
index 8a81d7f94680..730f213fd174 100644
--- a/posthog/hogql/direct_sql/postgres_adapter.py
+++ b/posthog/hogql/direct_sql/postgres_adapter.py
@@ -7,6 +7,7 @@ from psycopg.types.datetime import DateLoader
from posthog.hogql.constants import HogQLDialect
from posthog.hogql.direct_sql.adapter import DirectQueryRequest, DirectQueryResult
+from posthog.hogql.direct_sql.capability import is_direct_capable
from posthog.hogql.direct_sql.raw_sql import ensure_single_direct_statement
from posthog.hogql.errors import ExposedHogQLError
from posthog.hogql.escape_sql import escape_postgres_identifier
@@ -208,7 +209,8 @@ class PostgresAdapter:
from products.warehouse_sources.backend.facade.source_management import PostgresSource, SourceRegistry
from products.warehouse_sources.backend.facade.types import ExternalDataSourceType
- if not source.is_direct_postgres:
+ # Capability, not access_method: a synced source with the direct-query toggle on is valid too.
+ if not (is_direct_capable(source) and source.direct_engine == self.engine):
raise ExposedHogQLError("Invalid direct Postgres connection.")
postgres_source = cast(PostgresSource, SourceRegistry.get_source(ExternalDataSourceType.POSTGRES))
diff --git a/posthog/hogql/direct_sql/redshift_adapter.py b/posthog/hogql/direct_sql/redshift_adapter.py
index d11a0551bb3e..002d87bca700 100644
--- a/posthog/hogql/direct_sql/redshift_adapter.py
+++ b/posthog/hogql/direct_sql/redshift_adapter.py
@@ -8,6 +8,7 @@ from sqlparse import tokens as sqlparse_tokens
from posthog.hogql.constants import HogQLDialect
from posthog.hogql.direct_query_metrics import DIRECT_QUERY_ROW_CAP_EXCEEDED_TOTAL, observe_direct_query
from posthog.hogql.direct_sql.adapter import DirectQueryRequest, DirectQueryResult
+from posthog.hogql.direct_sql.capability import is_direct_capable
from posthog.hogql.direct_sql.postgres_adapter import postgres_error_to_message, postgres_oid_to_clickhouse_type
from posthog.hogql.direct_sql.raw_sql import ensure_single_direct_statement
from posthog.hogql.errors import ExposedHogQLError
@@ -103,7 +104,8 @@ class RedshiftAdapter:
from products.warehouse_sources.backend.facade.source_management import RedshiftSource, SourceRegistry
from products.warehouse_sources.backend.facade.types import ExternalDataSourceType
- if not source.is_direct_redshift:
+ # Capability, not access_method: a synced source with the direct-query toggle on is valid too.
+ if not (is_direct_capable(source) and source.direct_engine == self.engine):
raise ExposedHogQLError("Invalid direct Redshift connection.")
redshift_source = cast(RedshiftSource, SourceRegistry.get_source(ExternalDataSourceType.REDSHIFT))
diff --git a/posthog/hogql/direct_sql/snowflake_adapter.py b/posthog/hogql/direct_sql/snowflake_adapter.py
index 14136ea53dd3..4274e981e2f7 100644
--- a/posthog/hogql/direct_sql/snowflake_adapter.py
+++ b/posthog/hogql/direct_sql/snowflake_adapter.py
@@ -10,6 +10,7 @@ from sqlparse import tokens as sqlparse_tokens
from posthog.hogql.constants import HogQLDialect
from posthog.hogql.direct_query_metrics import DIRECT_QUERY_ROW_CAP_EXCEEDED_TOTAL, observe_direct_query
from posthog.hogql.direct_sql.adapter import DirectQueryRequest, DirectQueryResult
+from posthog.hogql.direct_sql.capability import is_direct_capable
from posthog.hogql.direct_sql.raw_sql import ensure_single_direct_statement
from posthog.hogql.errors import ExposedHogQLError
from posthog.hogql.snowflake_connection_cache import cached_snowflake_connection
@@ -162,7 +163,8 @@ class SnowflakeAdapter:
from products.warehouse_sources.backend.facade.source_management import SnowflakeSource, SourceRegistry
from products.warehouse_sources.backend.facade.types import ExternalDataSourceType
- if not source.is_direct_snowflake:
+ # Capability, not access_method: a synced source with the direct-query toggle on is valid too.
+ if not (is_direct_capable(source) and source.direct_engine == self.engine):
raise ExposedHogQLError("Invalid direct Snowflake connection.")
snowflake_source = cast(SnowflakeSource, SourceRegistry.get_source(ExternalDataSourceType.SNOWFLAKE))
diff --git a/posthog/hogql/query.py b/posthog/hogql/query.py
index f24b73e5ca09..530a1e7da133 100644
--- a/posthog/hogql/query.py
+++ b/posthog/hogql/query.py
@@ -550,6 +550,7 @@ class HogQLQueryExecutor:
self.connection_id,
user=self.user,
error_factory=ExposedHogQLError,
+ require_pure_direct=True,
)
if source is None:
raise ExposedHogQLError("Sending a raw query requires a valid connection.")
diff --git a/posthog/hogql/test/test_direct_connection.py b/posthog/hogql/test/test_direct_connection.py
new file mode 100644
index 000000000000..e93e7f3cea4d
--- /dev/null
+++ b/posthog/hogql/test/test_direct_connection.py
@@ -0,0 +1,43 @@
+from posthog.test.base import APIBaseTest
+
+from posthog.hogql.direct_connection import get_direct_connection_source
+
+from products.warehouse_sources.backend.facade.models import ExternalDataSource
+from products.warehouse_sources.backend.facade.types import ExternalDataSourceType
+
+
+class TestGetDirectConnectionSource(APIBaseTest):
+ def _create_source(self, *, access_method: str, direct_query_enabled: bool = True) -> ExternalDataSource:
+ return ExternalDataSource.objects.create(
+ team=self.team,
+ source_type=ExternalDataSourceType.POSTGRES,
+ access_method=access_method,
+ direct_query_enabled=direct_query_enabled,
+ job_inputs={"host": "h", "port": "5432", "database": "d", "user": "u", "password": "p", "schema": "public"},
+ )
+
+ def test_require_pure_direct_rejects_synced_warehouse_source(self):
+ # A synced source only exposes its `should_sync` catalog through the HogQL-compiled path —
+ # raw SQL has no such projection, so it must not resolve a connection for it.
+ source = self._create_source(access_method=ExternalDataSource.AccessMethod.WAREHOUSE)
+
+ resolved = get_direct_connection_source(self.team, str(source.id), require_pure_direct=True)
+
+ self.assertIsNone(resolved)
+
+ def test_require_pure_direct_allows_pure_direct_source(self):
+ source = self._create_source(access_method=ExternalDataSource.AccessMethod.DIRECT)
+
+ resolved = get_direct_connection_source(self.team, str(source.id), require_pure_direct=True)
+
+ assert resolved is not None
+ self.assertEqual(resolved.id, source.id)
+
+ def test_default_allows_synced_warehouse_source(self):
+ # The HogQL-compiled path (used by everything except sendRawQuery) is unaffected.
+ source = self._create_source(access_method=ExternalDataSource.AccessMethod.WAREHOUSE)
+
+ resolved = get_direct_connection_source(self.team, str(source.id))
+
+ assert resolved is not None
+ self.assertEqual(resolved.id, source.id)
diff --git a/posthog/hogql/test/test_direct_mysql_query.py b/posthog/hogql/test/test_direct_mysql_query.py
index 797b99c57121..750f8bb52401 100644
--- a/posthog/hogql/test/test_direct_mysql_query.py
+++ b/posthog/hogql/test/test_direct_mysql_query.py
@@ -11,7 +11,7 @@ from posthog.hogql.direct_sql.mysql_adapter import mysql_error_to_message, mysql
from posthog.hogql.errors import ExposedHogQLError, QueryError
from posthog.hogql.query import HogQLQueryExecutor
-from products.warehouse_sources.backend.facade.models import DataWarehouseTable, ExternalDataSource
+from products.warehouse_sources.backend.facade.models import DataWarehouseTable, ExternalDataSchema, ExternalDataSource
class TestDirectMySQLQuery(APIBaseTest):
@@ -424,3 +424,58 @@ class TestDirectMySQLQuery(APIBaseTest):
self.assertEqual(executed_statements[1], "START TRANSACTION READ ONLY")
self.assertEqual(response.results, [(1, "[email protected]")])
self.assertEqual(response.types, [("id", "Int64"), ("email", "String")])
+
+ def test_hogql_query_for_synced_source_prints_identical_sql_to_pure_direct(self):
+ direct_source = self._create_source(prefix="direct")
+ self._create_table(direct_source, "orders")
+ synced_source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id=str(uuid4()),
+ connection_id=str(uuid4()),
+ status=ExternalDataSource.Status.COMPLETED,
+ source_type="MySQL",
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ prefix="synced",
+ job_inputs={
+ "host": "localhost",
+ "port": 3306,
+ "database": "shop",
+ "user": "mysql",
+ "password": "mysql",
+ "schema": "shop",
+ "using_ssl": "true",
+ },
+ )
+ ExternalDataSchema.objects.create(
+ team=self.team,
+ name="orders",
+ source=synced_source,
+ should_sync=True,
+ sync_type_config={
+ "schema_metadata": {
+ "columns": [
+ {"name": "id", "data_type": "bigint", "is_nullable": False},
+ {"name": "email", "data_type": "text", "is_nullable": True},
+ {"name": "created_at", "data_type": "datetime", "is_nullable": True},
+ ],
+ "source_schema": "shop",
+ "source_table_name": "orders",
+ }
+ },
+ )
+
+ sql_by_mode = {}
+ for mode, source in (("direct", direct_source), ("synced", synced_source)):
+ executor = HogQLQueryExecutor(
+ query="SELECT id, email FROM orders WHERE id > 10",
+ team=self.team,
+ connection_id=str(source.id),
+ )
+ sql, _context = executor.generate_clickhouse_sql()
+ sql_by_mode[mode] = sql
+
+ # The virtual table built from schema metadata must print byte-identically to the
+ # physical pure-direct row for the same source location and columns.
+ self.assertEqual(sql_by_mode["synced"], sql_by_mode["direct"])
+ self.assertIn("shop.orders", sql_by_mode["synced"])
diff --git a/posthog/hogql/test/test_direct_postgres_query.py b/posthog/hogql/test/test_direct_postgres_query.py
index 121721d2ed88..31509c4f5a46 100644
--- a/posthog/hogql/test/test_direct_postgres_query.py
+++ b/posthog/hogql/test/test_direct_postgres_query.py
@@ -1819,3 +1819,106 @@ class TestDirectPostgresQuery(APIBaseTest):
self.assertEqual(mock_connect.call_args.kwargs["sslcert"], "/tmp/no.txt")
self.assertEqual(mock_connect.call_args.kwargs["sslkey"], "/tmp/no.txt")
self.assertEqual(mock_connect.call_args.kwargs["sslrootcert"], "/tmp/no.txt")
+
+ def test_hogql_query_for_synced_source_prints_identical_sql_to_pure_direct(self):
+ job_inputs = {
+ "host": "localhost",
+ "port": 5432,
+ "database": "postgres",
+ "user": "postgres",
+ "password": "postgres",
+ "schema": "public",
+ }
+ direct_source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="pure_direct_source",
+ connection_id="pure_direct_connection",
+ status=ExternalDataSource.Status.COMPLETED,
+ source_type="Postgres",
+ access_method=ExternalDataSource.AccessMethod.DIRECT,
+ prefix="direct",
+ job_inputs=job_inputs,
+ )
+ DataWarehouseTable.objects.create(
+ name="users",
+ format="Parquet",
+ team=self.team,
+ external_data_source=direct_source,
+ url_pattern="direct://postgres",
+ columns={"id": {"hogql": "IntegerDatabaseField", "clickhouse": "Int64", "valid": True}},
+ )
+ synced_source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="synced_source",
+ connection_id="synced_connection",
+ status=ExternalDataSource.Status.COMPLETED,
+ source_type="Postgres",
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ prefix="synced",
+ job_inputs=job_inputs,
+ )
+ ExternalDataSchema.objects.create(
+ team=self.team,
+ name="users",
+ source=synced_source,
+ should_sync=True,
+ sync_type_config={
+ "schema_metadata": {
+ "columns": [{"name": "id", "data_type": "integer", "is_nullable": False}],
+ "source_schema": "public",
+ "source_table_name": "users",
+ }
+ },
+ )
+
+ sql_by_mode = {}
+ for mode, source in (("direct", direct_source), ("synced", synced_source)):
+ executor = HogQLQueryExecutor(
+ query="SELECT id FROM users WHERE id > 10",
+ team=self.team,
+ connection_id=str(source.id),
+ )
+ sql, _context = executor.generate_clickhouse_sql()
+ sql_by_mode[mode] = sql
+
+ # The virtual table built from schema metadata must print byte-identically to the
+ # physical pure-direct row for the same source location and columns.
+ self.assertEqual(sql_by_mode["synced"], sql_by_mode["direct"])
+ self.assertIn("public.users", sql_by_mode["synced"])
+
+ @patch("posthog.hogql.direct_sql.postgres_adapter.psycopg.connect")
+ def test_send_raw_query_for_synced_source_raises_error(self, mock_connect):
+ # A synced source only exposes its `should_sync` catalog through the HogQL-compiled
+ # path — raw SQL has no such projection, so it's restricted to pure-direct connections.
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id="synced_source",
+ connection_id="synced_connection",
+ status=ExternalDataSource.Status.COMPLETED,
+ source_type="Postgres",
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ prefix="synced",
+ job_inputs={
+ "host": "localhost",
+ "port": 5432,
+ "database": "postgres",
+ "user": "postgres",
+ "password": "postgres",
+ "schema": "public",
+ },
+ )
+
+ executor = HogQLQueryExecutor(
+ query="SELECT 1 AS value",
+ team=self.team,
+ connection_id=str(source.id),
+ send_raw_query=True,
+ )
+
+ with self.assertRaises(ExposedHogQLError) as ctx:
+ executor.execute()
+
+ self.assertIn("Invalid connectionId", str(ctx.exception))
+ mock_connect.assert_not_called()
diff --git a/posthog/hogql/test/test_direct_redshift_query.py b/posthog/hogql/test/test_direct_redshift_query.py
index 1d14062923cb..c6945198d58f 100644
--- a/posthog/hogql/test/test_direct_redshift_query.py
+++ b/posthog/hogql/test/test_direct_redshift_query.py
@@ -7,7 +7,7 @@ from unittest.mock import MagicMock, patch
from parameterized import parameterized
-from posthog.hogql.direct_sql.redshift_adapter import ensure_read_only_raw_redshift_statement
+from posthog.hogql.direct_sql.redshift_adapter import RedshiftAdapter, ensure_read_only_raw_redshift_statement
from posthog.hogql.errors import ExposedHogQLError, QueryError
from posthog.hogql.query import HogQLQueryExecutor
@@ -173,6 +173,43 @@ class TestDirectRedshiftQuery(APIBaseTest):
with self.assertRaisesRegex(ExposedHogQLError, "Add a LIMIT clause"):
executor.execute()
+ @parameterized.expand(
+ [
+ ("synced_with_toggle_on", True, True),
+ ("synced_with_toggle_off", False, False),
+ ]
+ )
+ def test_validate_source_config_gates_on_capability(
+ self, _name: str, direct_query_enabled: bool, expect_valid: bool
+ ):
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_id=str(uuid4()),
+ connection_id=str(uuid4()),
+ status=ExternalDataSource.Status.COMPLETED,
+ source_type="Redshift",
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=direct_query_enabled,
+ prefix="synced",
+ job_inputs={
+ "host": "localhost",
+ "port": 5439,
+ "database": "dev",
+ "user": "awsuser",
+ "password": "redshift",
+ "schema": "public",
+ },
+ )
+
+ adapter = RedshiftAdapter()
+ if expect_valid:
+ implementation, config = adapter.validate_source_config(source, self.team)
+ self.assertIsNotNone(implementation)
+ self.assertEqual(config.host, "localhost")
+ else:
+ with self.assertRaisesRegex(ExposedHogQLError, "Invalid direct Redshift connection."):
+ adapter.validate_source_config(source, self.team)
+
class TestEnsureReadOnlyRawRedshiftStatement(unittest.TestCase):
@parameterized.expand(
diff --git a/posthog/hogql/test/test_query.py b/posthog/hogql/test/test_query.py
index aefc6a11f122..8352ac51157a 100644
--- a/posthog/hogql/test/test_query.py
+++ b/posthog/hogql/test/test_query.py
@@ -297,15 +297,26 @@ class TestQuery(ClickhouseTestMixin, APIBaseTest):
self.assertEqual(response.results[0][2], "bla")
self.assertEqual(response.results[0][3], UUID("00000000-0000-4000-8000-000000000000"))
- def test_execute_hogql_query_rejects_non_direct_connection_id(self):
+ @parameterized.expand(
+ [
+ # No direct engine exists for the type at all.
+ ("no_engine_for_type", ExternalDataSourceType.STRIPE, True),
+ # Engine exists, but the per-source direct-query toggle is off.
+ ("direct_query_disabled", ExternalDataSourceType.POSTGRES, False),
+ ]
+ )
+ def test_execute_hogql_query_rejects_non_capable_connection_id(
+ self, _name: str, source_type: str, direct_query_enabled: bool
+ ):
selected_source = ExternalDataSource.objects.create(
source_id="selected-upstream-source",
connection_id="selected-connection",
destination_id="destination-1",
team=self.team,
status=ExternalDataSource.Status.COMPLETED,
- source_type=ExternalDataSourceType.STRIPE,
+ source_type=source_type,
access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=direct_query_enabled,
prefix="stripe",
)
with self.assertRaises(ExposedHogQLError) as error:
diff --git a/posthog/hogql_queries/access_controlled_resources.py b/posthog/hogql_queries/access_controlled_resources.py
index 06b7b29509de..5f35d6d66732 100644
--- a/posthog/hogql_queries/access_controlled_resources.py
+++ b/posthog/hogql_queries/access_controlled_resources.py
@@ -41,6 +41,16 @@ def queried_access_controlled_resources(query, team: "Team") -> Optional[set[str
system_scopes = {f"system.{name}": scope for name, scope in access_controlled_system_tables().items()}
scopes: set[str] = {system_scopes[name] for name in table_names if name in system_scopes}
+ # Connection-scoped queries read the external source's upstream data directly. Their tables
+ # are virtual (named by ExternalDataSchema.name) or physical direct rows, which the
+ # warehouse-table name lookup below can't reliably match — so fail closed and partition the
+ # cache by both gates execution enforces: source viewer access (the connection resolver) and
+ # backing warehouse-table access (the virtual-table build). Without this, a denied user
+ # could be served an allowed user's cached upstream rows on a cache hit.
+ if getattr(query, "connectionId", None):
+ scopes.add("external_data_source")
+ scopes.add("warehouse_table")
+
# Warehouse tables/views are per-team and dynamic, and the HogQL schema isn't built here (the
# fingerprint runs before any database), so resolve referenced warehouse objects with a light
# name lookup. We only add the scope here; the specific denied object IDs are folded into the
diff --git a/posthog/hogql_queries/test/test_access_controlled_resources.py b/posthog/hogql_queries/test/test_access_controlled_resources.py
index 38ad4631d329..00575e1366a0 100644
--- a/posthog/hogql_queries/test/test_access_controlled_resources.py
+++ b/posthog/hogql_queries/test/test_access_controlled_resources.py
@@ -60,6 +60,13 @@ class TestQueriedAccessControlledResources(BaseTest):
def test_unparseable_hogql_fails_closed(self):
assert queried_access_controlled_resources(HogQLQuery(query="select from from"), self.team) is None
+ def test_connection_query_partitions_on_source_and_warehouse_scopes(self):
+ # A connection query reads virtual tables named by ExternalDataSchema.name, which the
+ # warehouse-table name lookup can't match — without these scopes a user denied the source
+ # (or its backing table) would replay an allowed user's cached upstream rows.
+ query = HogQLQuery(query="select * from public.users", connectionId="00000000-0000-0000-0000-000000000001")
+ assert queried_access_controlled_resources(query, self.team) == {"external_data_source", "warehouse_table"}
+
def test_structured_query_reads_no_system_table(self):
query = TrendsQuery(series=[EventsNode(event="$pageview")])
assert queried_access_controlled_resources(query, self.team) == set()
diff --git a/posthog/schema.py b/posthog/schema.py
index 9fa2f6ff314d..440cbae93a6a 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -14997,7 +14997,10 @@ class DatabaseSchemaDataWarehouseTable(BaseModel):
extra="forbid",
)
fields: dict[str, DatabaseSchemaField]
- format: str
+ format: str | None = Field(
+ default=None,
+ description=("Absent for a dual-mode source's virtual tables, which have no synced S3 backing."),
+ )
id: str
name: str
row_count: float | None = None
@@ -15010,7 +15013,10 @@ class DatabaseSchemaDataWarehouseTable(BaseModel):
)
source: DatabaseSchemaSource | None = None
type: Literal["data_warehouse"] = "data_warehouse"
- url_pattern: str
+ url_pattern: str | None = Field(
+ default=None,
+ description=("Absent for a dual-mode source's virtual tables, which have no synced S3 backing."),
+ )
class DocumentSimilarityQueryResponse(BaseModel):
@@ -24024,9 +24030,9 @@ class HogQLQuery(BaseModel):
connectionId: str | None = Field(
default=None,
description=(
- "Optional id of a direct external data source (access_method='direct') to"
- " run against instead of ClickHouse. Warehouse import sources are not valid"
- " here."
+ "Optional id of a direct-query-capable external data source to run against"
+ " instead of ClickHouse — a pure-direct source, or a synced source with"
+ " direct query enabled."
),
)
explain: bool | None = None
@@ -28103,9 +28109,9 @@ class HogQLAutocomplete(BaseModel):
connectionId: str | None = Field(
default=None,
description=(
- "Optional id of a direct external data source (access_method='direct') to"
- " run against instead of ClickHouse. Warehouse import sources are not valid"
- " here."
+ "Optional id of a direct-query-capable external data source to run against"
+ " instead of ClickHouse — a pure-direct source, or a synced source with"
+ " direct query enabled."
),
)
endPosition: int = Field(..., description="End position of the editor word")
@@ -28199,9 +28205,9 @@ class HogQLMetadata(BaseModel):
connectionId: str | None = Field(
default=None,
description=(
- "Optional id of a direct external data source (access_method='direct') to"
- " run against instead of ClickHouse. Warehouse import sources are not valid"
- " here."
+ "Optional id of a direct-query-capable external data source to run against"
+ " instead of ClickHouse — a pure-direct source, or a synced source with"
+ " direct query enabled."
),
)
debug: bool | None = Field(
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index 90d07720f263..a1e99019a731 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -5882,7 +5882,7 @@ export type HogQLQueryApiValues = { [key: string]: unknown } | null
export type HogQLQueryApiVariables = { [key: string]: HogQLVariableApi } | null
export interface HogQLQueryApi {
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string | null
explain?: boolean | null
filters?: HogQLFiltersApi | null
diff --git a/products/data_warehouse/backend/direct_virtual_tables.py b/products/data_warehouse/backend/direct_virtual_tables.py
new file mode 100644
index 000000000000..1eb81b65337c
--- /dev/null
+++ b/products/data_warehouse/backend/direct_virtual_tables.py
@@ -0,0 +1,200 @@
+"""Virtual direct-query tables for synced (dual-mode) sources.
+
+A synced SQL source with ``direct_query_enabled`` has no physical ``DataWarehouseTable``
+rows for its live tables — its physical rows are the synced S3 copies, which are
+deliberately excluded from the direct catalog. This builds the same ``DirectSQLTable``
+objects the pure-direct path derives from physical rows, but from each
+``ExternalDataSchema``'s persisted ``schema_metadata`` instead.
+"""
+
+from typing import TYPE_CHECKING
+
+from posthog.hogql.database.direct_mysql_table import DirectMySQLTable
+from posthog.hogql.database.direct_postgres_table import DirectPostgresTable
+from posthog.hogql.database.direct_redshift_table import DirectRedshiftTable
+from posthog.hogql.database.direct_snowflake_table import DirectSnowflakeTable
+from posthog.hogql.database.direct_sql_table import DirectSQLTable
+
+from products.data_warehouse.backend.mysql_helpers import (
+ get_default_mysql_schema,
+ get_mysql_source_location,
+ mysql_schema_metadata_to_dwh_columns,
+)
+from products.data_warehouse.backend.postgres_helpers import (
+ get_postgres_source_location,
+ postgres_schema_metadata_to_dwh_columns,
+)
+from products.data_warehouse.backend.redshift_helpers import (
+ get_default_redshift_catalog,
+ get_default_redshift_schema,
+ get_redshift_source_location,
+ redshift_schema_metadata_to_dwh_columns,
+)
+from products.data_warehouse.backend.snowflake_helpers import (
+ get_default_snowflake_catalog,
+ get_default_snowflake_schema,
+ get_snowflake_source_location,
+ snowflake_schema_metadata_to_dwh_columns,
+)
+from products.warehouse_sources.backend.facade.hogql import hogql_fields_and_structure_for_columns
+from products.warehouse_sources.backend.facade.models import ExternalDataSchema
+from products.warehouse_sources.backend.temporal.data_imports.sources.common.sql.projection import (
+ filter_dwh_columns_by_enabled_columns,
+)
+
+if TYPE_CHECKING:
+ from products.warehouse_sources.backend.facade.models import ExternalDataSource
+
+
+def eligible_direct_query_schemas(team_id: int, source_id: str) -> list[ExternalDataSchema]:
+ """The synced schema rows a dual-mode connection exposes as live virtual tables.
+
+ Single source of truth for both the build path (``_fetch_sources``) and the serialize
+ catalog, so the two selections can't drift. Excludes rows without usable ``schema_metadata``
+ (e.g. discovered before metadata persistence shipped) and rows with ``row_filters`` — a
+ sync-time row restriction the live direct query can't reproduce, so exposing the upstream
+ table would let a user read rows the schema was configured not to sync.
+ """
+ return [
+ schema_row
+ for schema_row in ExternalDataSchema.objects.filter(
+ team_id=team_id,
+ source_id=source_id,
+ should_sync=True,
+ )
+ .exclude(deleted=True)
+ # `table` is the synced S3 row backing the warehouse access-control check on the build path.
+ .select_related("table")
+ .order_by("name")
+ if schema_row.schema_metadata and not schema_row.row_filters
+ ]
+
+
+def build_direct_table_for_schema(schema: "ExternalDataSchema", source: "ExternalDataSource") -> DirectSQLTable | None:
+ """Build the live-query table for one schema row of a dual-mode source.
+
+ Returns None when the source's engine is unknown or the schema row carries no usable
+ column metadata (e.g. discovered before metadata persistence shipped).
+ """
+ metadata = schema.schema_metadata
+ engine = source.direct_engine
+
+ # Defense in depth for any direct caller: a row-filtered schema is already excluded from the
+ # catalog by eligible_direct_query_schemas; never build a live table that would bypass it.
+ if schema.row_filters:
+ return None
+
+ if engine == "postgres":
+ columns = postgres_schema_metadata_to_dwh_columns(metadata)
+ if not columns:
+ return None
+ columns = filter_dwh_columns_by_enabled_columns(
+ columns,
+ schema.enabled_columns,
+ schema.primary_key_columns,
+ schema.incremental_field,
+ # Direct-postgres columns are keyed by raw, case-sensitive source names.
+ normalize=False,
+ )
+ fields, _ = hogql_fields_and_structure_for_columns(columns)
+ catalog, postgres_schema, table_name = get_postgres_source_location(
+ schema_name=schema.name,
+ schema_metadata=metadata,
+ default_schema=(source.job_inputs or {}).get("schema"),
+ )
+ return DirectPostgresTable(
+ name=schema.name,
+ fields=fields,
+ postgres_catalog=catalog,
+ postgres_schema=postgres_schema,
+ postgres_table_name=table_name,
+ external_data_source_id=str(source.id),
+ connection_metadata=source.connection_metadata,
+ )
+
+ if engine == "mysql":
+ columns = mysql_schema_metadata_to_dwh_columns(metadata)
+ if not columns:
+ return None
+ columns = filter_dwh_columns_by_enabled_columns(
+ columns,
+ schema.enabled_columns,
+ schema.primary_key_columns,
+ schema.incremental_field,
+ # Direct-mysql columns are keyed by raw, case-sensitive source names.
+ normalize=False,
+ )
+ fields, _ = hogql_fields_and_structure_for_columns(columns)
+ mysql_schema, table_name = get_mysql_source_location(
+ schema_name=schema.name,
+ schema_metadata=metadata,
+ default_schema=get_default_mysql_schema(source),
+ )
+ return DirectMySQLTable(
+ name=schema.name,
+ fields=fields,
+ mysql_schema=mysql_schema,
+ mysql_table_name=table_name,
+ external_data_source_id=str(source.id),
+ connection_metadata=source.connection_metadata,
+ )
+
+ if engine == "redshift":
+ columns = redshift_schema_metadata_to_dwh_columns(metadata)
+ if not columns:
+ return None
+ columns = filter_dwh_columns_by_enabled_columns(
+ columns,
+ schema.enabled_columns,
+ schema.primary_key_columns,
+ schema.incremental_field,
+ # Direct-redshift columns are keyed by raw, case-sensitive source names.
+ normalize=False,
+ )
+ fields, _ = hogql_fields_and_structure_for_columns(columns)
+ catalog, redshift_schema, table_name = get_redshift_source_location(
+ schema_name=schema.name,
+ schema_metadata=metadata,
+ default_catalog=get_default_redshift_catalog(source),
+ default_schema=get_default_redshift_schema(source),
+ )
+ return DirectRedshiftTable(
+ name=schema.name,
+ fields=fields,
+ postgres_catalog=catalog,
+ postgres_schema=redshift_schema,
+ postgres_table_name=table_name,
+ external_data_source_id=str(source.id),
+ connection_metadata=source.connection_metadata,
+ )
+
+ if engine == "snowflake":
+ columns = snowflake_schema_metadata_to_dwh_columns(metadata)
+ if not columns:
+ return None
+ columns = filter_dwh_columns_by_enabled_columns(
+ columns,
+ schema.enabled_columns,
+ schema.primary_key_columns,
+ schema.incremental_field,
+ # Direct-snowflake columns are keyed by raw, case-sensitive source names.
+ normalize=False,
+ )
+ fields, _ = hogql_fields_and_structure_for_columns(columns)
+ catalog, snowflake_schema, table_name = get_snowflake_source_location(
+ schema_name=schema.name,
+ schema_metadata=metadata,
+ default_catalog=get_default_snowflake_catalog(source),
+ default_schema=get_default_snowflake_schema(source),
+ )
+ return DirectSnowflakeTable(
+ name=schema.name,
+ fields=fields,
+ snowflake_catalog=catalog,
+ snowflake_schema=snowflake_schema,
+ snowflake_table_name=table_name,
+ external_data_source_id=str(source.id),
+ connection_metadata=source.connection_metadata,
+ )
+
+ return None
diff --git a/products/data_warehouse/backend/facade/direct_query.py b/products/data_warehouse/backend/facade/direct_query.py
new file mode 100644
index 000000000000..23f45a301b9a
--- /dev/null
+++ b/products/data_warehouse/backend/facade/direct_query.py
@@ -0,0 +1,16 @@
+"""
+Direct-query wiring for data_warehouse.
+
+Re-exports the virtual-table builder the HogQL database builder calls for dual-mode
+(synced, direct-query-enabled) connections. Its own facade submodule — separate from
+``facade.hogql``, which ``database.py`` imports at module level — so the engine helper
+modules it pulls stay off the ``django.setup()`` path; consumers import it
+function-locally.
+"""
+
+from products.data_warehouse.backend.direct_virtual_tables import (
+ build_direct_table_for_schema,
+ eligible_direct_query_schemas,
+)
+
+__all__ = ["build_direct_table_for_schema", "eligible_direct_query_schemas"]
diff --git a/products/data_warehouse/backend/presentation/views/external_data_source.py b/products/data_warehouse/backend/presentation/views/external_data_source.py
index 5b8c22d5fa4b..ac2d62aaa1c9 100644
--- a/products/data_warehouse/backend/presentation/views/external_data_source.py
+++ b/products/data_warehouse/backend/presentation/views/external_data_source.py
@@ -568,11 +568,31 @@ class ExternalDataSourceConnectionOptionSerializer(serializers.ModelSerializer):
choices=DIRECT_CONNECTION_ENGINE_CHOICES,
help_text="Backend engine detected for the direct connection.",
)
+ source_type = serializers.ChoiceField(
+ choices=ExternalDataSourceType.choices,
+ read_only=True,
+ help_text="The source type (e.g. 'Postgres', 'MySQL', 'Snowflake').",
+ )
+ access_method = serializers.ChoiceField(
+ choices=ExternalDataSource.AccessMethod.choices,
+ read_only=True,
+ help_text="'direct' for pure live-query sources; 'warehouse' for synced sources with direct query enabled.",
+ )
+ supports_hogql = serializers.SerializerMethodField(
+ help_text="Whether HogQL queries compile for this connection. When false, only raw SQL (sendRawQuery) works.",
+ )
+
+ @extend_schema_field(serializers.BooleanField())
+ def get_supports_hogql(self, source: ExternalDataSource) -> bool:
+ # Function-local: keeps the direct-SQL driver imports off the django.setup() path.
+ from posthog.hogql.direct_sql.capability import direct_supports_hogql # noqa: PLC0415
+
+ return direct_supports_hogql(source)
class Meta:
model = ExternalDataSource
- fields = ["id", "prefix", "engine"]
- read_only_fields = ["id", "prefix", "engine"]
+ fields = ["id", "prefix", "engine", "source_type", "access_method", "supports_hogql"]
+ read_only_fields = ["id", "prefix", "engine", "source_type", "access_method", "supports_hogql"]
class ExternalDataSourceBulkUpdateSchemaSerializer(serializers.Serializer):
@@ -761,7 +781,7 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializer
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."
+ "Defaults to false for new sources; ignored for pure direct-query sources."
),
)
@@ -1277,10 +1297,10 @@ class ExternalDataSourceCreateSerializer(serializers.Serializer):
)
direct_query_enabled = serializers.BooleanField(
required=False,
- default=True,
+ default=False,
help_text=(
"Whether a synced source should also be live-queryable via direct connection. "
- "Defaults to true; ignored for pure direct-query sources."
+ "Defaults to false; ignored for pure direct-query sources."
),
)
@@ -1318,10 +1338,10 @@ class SourceSetupSerializer(serializers.Serializer):
)
direct_query_enabled = serializers.BooleanField(
required=False,
- default=True,
+ default=False,
help_text=(
"Whether a synced source should also be live-queryable via direct connection. "
- "Defaults to true; ignored for pure direct-query sources."
+ "Defaults to false; ignored for pure direct-query sources."
),
)
@@ -1770,7 +1790,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),
+ direct_query_enabled=serializer.validated_data.get("direct_query_enabled", False),
)
@extend_schema(
@@ -1864,7 +1884,7 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
description: str | None,
access_method: str,
created_via: str,
- direct_query_enabled: bool = True,
+ direct_query_enabled: bool = False,
skip_credential_validation: bool = False,
) -> Response:
# `skip_credential_validation` is set only by the `setup` action, which has already run the
@@ -3059,7 +3079,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),
+ direct_query_enabled=serializer.validated_data.get("direct_query_enabled", False),
skip_credential_validation=True,
)
# Stored credentials are single-use: once the source owns them (in job_inputs), drop the stash.
@@ -4163,11 +4183,12 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi
queryset = (
ExternalDataSource._base_manager.filter(
team_id=self.team_id,
- access_method=ExternalDataSource.AccessMethod.DIRECT,
source_type__in=direct_capable_source_types(),
)
+ # Pure-direct sources are always live; synced sources only when the toggle is on.
+ .filter(Q(access_method=ExternalDataSource.AccessMethod.DIRECT) | Q(direct_query_enabled=True))
.exclude(deleted=True)
- .only("id", "prefix", "connection_metadata")
+ .only("id", "prefix", "connection_metadata", "source_type", "access_method")
.order_by(self.ordering)
)
queryset = self.user_access_control.filter_queryset_by_access_level(queryset)
diff --git a/products/data_warehouse/backend/test/test_direct_virtual_tables.py b/products/data_warehouse/backend/test/test_direct_virtual_tables.py
new file mode 100644
index 000000000000..35d1d69ee713
--- /dev/null
+++ b/products/data_warehouse/backend/test/test_direct_virtual_tables.py
@@ -0,0 +1,52 @@
+from posthog.test.base import APIBaseTest
+
+from products.data_warehouse.backend.direct_virtual_tables import build_direct_table_for_schema
+from products.warehouse_sources.backend.facade.models import ExternalDataSchema, ExternalDataSource
+from products.warehouse_sources.backend.facade.types import ExternalDataSourceType
+
+SCHEMA_METADATA = {
+ "columns": [
+ {"name": "id", "data_type": "integer", "is_nullable": False},
+ {"name": "email", "data_type": "varchar(255)", "is_nullable": True},
+ {"name": "secret", "data_type": "varchar(255)", "is_nullable": True},
+ ]
+}
+
+
+class TestBuildDirectTableForSchema(APIBaseTest):
+ def _create(self, *, enabled_columns: list[str] | None) -> tuple[ExternalDataSchema, ExternalDataSource]:
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_type=ExternalDataSourceType.POSTGRES,
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ job_inputs={"host": "h", "port": "5432", "database": "d", "user": "u", "password": "p", "schema": "public"},
+ )
+ schema = ExternalDataSchema.objects.create(
+ name="customers",
+ team=self.team,
+ source=source,
+ enabled_columns=enabled_columns,
+ sync_type_config={"schema_metadata": SCHEMA_METADATA, "primary_key_columns": ["id"]},
+ )
+ return schema, source
+
+ def test_deselected_column_excluded_from_direct_table(self):
+ # A user with only "enabled_columns": ["email"] must not be able to read "secret"
+ # through the live-query virtual table, even though it's in schema_metadata.
+ schema, source = self._create(enabled_columns=["email"])
+
+ table = build_direct_table_for_schema(schema, source)
+
+ assert table is not None
+ assert "secret" not in table.fields
+ assert "email" in table.fields
+ assert "id" in table.fields # primary key always retained
+
+ def test_none_enabled_columns_syncs_everything(self):
+ schema, source = self._create(enabled_columns=None)
+
+ table = build_direct_table_for_schema(schema, source)
+
+ assert table is not None
+ assert set(table.fields) == {"id", "email", "secret"}
diff --git a/products/data_warehouse/backend/tests/api/test_external_data_source.py b/products/data_warehouse/backend/tests/api/test_external_data_source.py
index ab69fa4135bc..460708c12868 100644
--- a/products/data_warehouse/backend/tests/api/test_external_data_source.py
+++ b/products/data_warehouse/backend/tests/api/test_external_data_source.py
@@ -476,7 +476,7 @@ class TestExternalDataSource(APIBaseTest):
@parameterized.expand(
[
- ("omitted_defaults_true", {}, True),
+ ("omitted_defaults_false", {}, False),
("explicit_true", {"direct_query_enabled": True}, True),
("explicit_false", {"direct_query_enabled": False}, False),
]
@@ -560,17 +560,17 @@ class TestExternalDataSource(APIBaseTest):
def test_patch_external_data_source_toggles_direct_query_enabled(self):
source = self._create_external_data_source()
- assert source.direct_query_enabled is True
+ assert source.direct_query_enabled is False
response = self.client.patch(
f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/",
- data={"direct_query_enabled": False},
+ data={"direct_query_enabled": True},
)
assert response.status_code == 200, response.json()
- assert response.json()["direct_query_enabled"] is False
+ assert response.json()["direct_query_enabled"] is True
source.refresh_from_db()
- assert source.direct_query_enabled is False
+ assert source.direct_query_enabled is True
@patch(
"products.warehouse_sources.backend.temporal.data_imports.sources.postgres.source.PostgresSource.validate_credentials_for_access_method",
@@ -1763,20 +1763,77 @@ class TestExternalDataSource(APIBaseTest):
"id": str(snowflake_source.pk),
"prefix": "Analytics Snowflake",
"engine": "snowflake",
+ "source_type": "Snowflake",
+ "access_method": "direct",
+ "supports_hogql": True,
},
{
"id": str(postgres_source.pk),
"prefix": "Primary database",
"engine": "duckdb",
+ "source_type": "Postgres",
+ "access_method": "direct",
+ "supports_hogql": True,
},
{
"id": str(mysql_source.pk),
"prefix": "Reporting MySQL",
"engine": "mysql",
+ "source_type": "MySQL",
+ "access_method": "direct",
+ "supports_hogql": True,
},
],
)
+ def test_connections_lists_synced_sources_only_when_direct_query_enabled(self):
+ enabled_synced = ExternalDataSource.objects.create(
+ team_id=self.team.pk,
+ source_id=str(uuid.uuid4()),
+ connection_id=str(uuid.uuid4()),
+ destination_id=str(uuid.uuid4()),
+ source_type="Postgres",
+ created_by=self.user,
+ prefix="Enabled synced",
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ job_inputs={"host": "localhost", "password": "secret"},
+ )
+ # Toggle off: must not be listed.
+ ExternalDataSource.objects.create(
+ team_id=self.team.pk,
+ source_id=str(uuid.uuid4()),
+ connection_id=str(uuid.uuid4()),
+ destination_id=str(uuid.uuid4()),
+ source_type="Postgres",
+ created_by=self.user,
+ prefix="Disabled synced",
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=False,
+ job_inputs={"host": "localhost", "password": "secret"},
+ )
+ # No direct engine for the type: must not be listed even with the toggle on.
+ ExternalDataSource.objects.create(
+ team_id=self.team.pk,
+ source_id=str(uuid.uuid4()),
+ connection_id=str(uuid.uuid4()),
+ destination_id=str(uuid.uuid4()),
+ source_type="Stripe",
+ created_by=self.user,
+ prefix="Stripe synced",
+ access_method=ExternalDataSource.AccessMethod.WAREHOUSE,
+ direct_query_enabled=True,
+ )
+
+ response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/connections/")
+
+ self.assertEqual(response.status_code, 200)
+ payload = response.json()
+ self.assertEqual([item["id"] for item in payload], [str(enabled_synced.pk)])
+ self.assertEqual(payload[0]["access_method"], "warehouse")
+ self.assertEqual(payload[0]["source_type"], "Postgres")
+ self.assertEqual(payload[0]["supports_hogql"], True)
+
def test_dont_expose_job_inputs(self):
self._create_external_data_source()
diff --git a/products/data_warehouse/frontend/shared/components/SourceIcon.tsx b/products/data_warehouse/frontend/shared/components/SourceIcon.tsx
index 70472f432f76..ea1382d2430f 100644
--- a/products/data_warehouse/frontend/shared/components/SourceIcon.tsx
+++ b/products/data_warehouse/frontend/shared/components/SourceIcon.tsx
@@ -25,7 +25,10 @@ import { getDataWarehouseSourceUrl } from './ManagedSourcesTable'
* heuristic to guess, then fallback to a shrugging hedgehog.
* @param url
*/
-export function mapUrlToProvider(url: string): string {
+export function mapUrlToProvider(url: string | undefined): string {
+ if (!url) {
+ return 'BlushingHog'
+ }
if (url.includes('amazonaws.com')) {
return 'aws'
} else if (url.startsWith('https://storage.googleapis.com')) {
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index 642ec42b57a9..6c4aa15f2699 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -5235,7 +5235,7 @@ export type HogQLQueryApiValues = { [key: string]: unknown } | null
export type HogQLQueryApiVariables = { [key: string]: HogQLVariableApi } | null
export interface HogQLQueryApi {
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string | null
explain?: boolean | null
filters?: HogQLFiltersApi | null
diff --git a/products/warehouse_sources/backend/facade/hogql.py b/products/warehouse_sources/backend/facade/hogql.py
index 933ab792441b..306d413b6729 100644
--- a/products/warehouse_sources/backend/facade/hogql.py
+++ b/products/warehouse_sources/backend/facade/hogql.py
@@ -21,6 +21,7 @@ from products.warehouse_sources.backend.models.table import (
SERIALIZED_FIELD_TO_CLICKHOUSE_MAPPING,
DataWarehouseTable,
DataWarehouseTableColumns,
+ hogql_fields_and_structure_for_columns,
)
# Table/type resolution used by the HogQL database builder and query runners. These return
@@ -47,6 +48,7 @@ __all__ = [
"ExternalDataSource",
"clean_type",
"get_view_or_table_by_name",
+ "hogql_fields_and_structure_for_columns",
"reconstruct_ordered_columns",
"remove_named_tuples",
]
diff --git a/products/warehouse_sources/backend/migrations/0067_direct_query_enabled_default_false.py b/products/warehouse_sources/backend/migrations/0067_direct_query_enabled_default_false.py
new file mode 100644
index 000000000000..873790364bc6
--- /dev/null
+++ b/products/warehouse_sources/backend/migrations/0067_direct_query_enabled_default_false.py
@@ -0,0 +1,13 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [("warehouse_sources", "0066_alter_externaldatasource_source_type_and_more")]
+
+ operations = [
+ migrations.AlterField(
+ model_name="externaldatasource",
+ name="direct_query_enabled",
+ field=models.BooleanField(default=False),
+ ),
+ ]
diff --git a/products/warehouse_sources/backend/migrations/0068_backfill_direct_query_enabled_false.py b/products/warehouse_sources/backend/migrations/0068_backfill_direct_query_enabled_false.py
new file mode 100644
index 000000000000..b21744cf401d
--- /dev/null
+++ b/products/warehouse_sources/backend/migrations/0068_backfill_direct_query_enabled_false.py
@@ -0,0 +1,18 @@
+from django.db import migrations
+
+
+def forwards(apps, schema_editor):
+ # ExternalDataSource is one row per configured source (thousands, not events-scale), so a
+ # single update is safe — no batching needed.
+ ExternalDataSource = apps.get_model("warehouse_sources", "ExternalDataSource")
+ ExternalDataSource.objects.filter(access_method="warehouse", direct_query_enabled=True).update(
+ direct_query_enabled=False
+ )
+
+
+class Migration(migrations.Migration):
+ dependencies = [("warehouse_sources", "0067_direct_query_enabled_default_false")]
+
+ 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 7920fa48b4f3..3feaef4bc8da 100644
--- a/products/warehouse_sources/backend/migrations/max_migration.txt
+++ b/products/warehouse_sources/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0066_alter_externaldatasource_source_type_and_more
+0068_backfill_direct_query_enabled_false
diff --git a/products/warehouse_sources/backend/models/external_data_source.py b/products/warehouse_sources/backend/models/external_data_source.py
index 0ba837f89b63..94983932cc02 100644
--- a/products/warehouse_sources/backend/models/external_data_source.py
+++ b/products/warehouse_sources/backend/models/external_data_source.py
@@ -66,7 +66,8 @@ class ExternalDataSource(ModelActivityMixin, CreatedMetaFields, UpdatedMetaField
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)
+ # Off by default — a user opts a synced source in explicitly before it becomes live-queryable.
+ direct_query_enabled = models.BooleanField(default=False)
# DEPRECATED: Check inside `revenue_analytics_config` instead
revenue_analytics_enabled = models.BooleanField(default=False, blank=True, null=True)
@@ -186,12 +187,17 @@ def get_direct_external_data_source_for_connection(
except ValueError:
return None
- return (
+ # Function-local: capability imports this module (circular); also keeps direct-SQL drivers off django.setup().
+ from posthog.hogql.direct_sql.capability import is_direct_capable # noqa: PLC0415
+
+ source = (
ExternalDataSource.objects.filter(
team_id=team_id,
id=source_uuid,
- access_method=ExternalDataSource.AccessMethod.DIRECT,
)
.exclude(deleted=True)
.first()
)
+ if source is None or not is_direct_capable(source):
+ return None
+ return source
diff --git a/products/warehouse_sources/backend/models/table.py b/products/warehouse_sources/backend/models/table.py
index e06c5f4311c1..fef39458dfd1 100644
--- a/products/warehouse_sources/backend/models/table.py
+++ b/products/warehouse_sources/backend/models/table.py
@@ -164,6 +164,93 @@ class DataWarehouseTableManager(models.Manager["DataWarehouseTable"]):
return self.get_queryset().queryable()
+def get_hogql_field_for_column(
+ column_name: str,
+ column_definition: dict[str, Any] | str,
+ clickhouse_type: str,
+ is_nullable: bool,
+) -> DatabaseField:
+ if isinstance(column_definition, dict) and column_definition.get("hogql") == "StructDatabaseField":
+ child_fields: dict[str, DatabaseField] = {}
+ nested_definitions = column_definition.get("fields")
+ if isinstance(nested_definitions, dict):
+ for nested_name, nested_definition in nested_definitions.items():
+ if not isinstance(nested_definition, dict):
+ continue
+
+ nested_clickhouse_type = str(nested_definition.get("clickhouse", "String"))
+ nested_is_nullable = False
+ if nested_clickhouse_type.startswith("Nullable("):
+ nested_clickhouse_type = nested_clickhouse_type.replace("Nullable(", "")[:-1]
+ nested_is_nullable = True
+
+ child_fields[nested_name] = get_hogql_field_for_column(
+ nested_name,
+ nested_definition,
+ nested_clickhouse_type,
+ nested_is_nullable,
+ )
+
+ return StructDatabaseField(name=column_name, nullable=is_nullable, fields=child_fields)
+
+ # Support for 'old' style columns
+ if isinstance(column_definition, str):
+ hogql_type_str = clickhouse_type.partition("(")[0]
+ return CLICKHOUSE_HOGQL_MAPPING[hogql_type_str](name=column_name, nullable=is_nullable)
+
+ return STR_TO_HOGQL_MAPPING.get(
+ str(column_definition.get("hogql", "UnknownDatabaseField")),
+ STR_TO_HOGQL_MAPPING["UnknownDatabaseField"],
+ )(name=column_name, nullable=is_nullable)
+
+
+def hogql_fields_and_structure_for_columns(
+ columns: dict[str, Any],
+ modifiers: Optional["HogQLQueryModifiers"] = None,
+ column_order: list[str] | None = None,
+) -> tuple[dict[str, FieldOrTable], list[str]]:
+ """Shared columns → HogQL fields mapping for warehouse and direct virtual tables.
+
+ Structure entries (the S3 table-function column spec) are only meaningful for S3-backed
+ tables; direct virtual tables ignore them. ``column_order`` restores the SELECT order the
+ jsonb column store drops (see ``reconstruct_ordered_columns``); omit it for column dicts
+ whose insertion order is already meaningful.
+ """
+ fields: dict[str, FieldOrTable] = {}
+ structure = []
+ for column, type in reconstruct_ordered_columns(columns, column_order):
+ # Support for 'old' style columns
+ if isinstance(type, str):
+ clickhouse_type = type
+ else:
+ clickhouse_type = type["clickhouse"]
+
+ is_nullable = False
+
+ if clickhouse_type.startswith("Nullable("):
+ clickhouse_type = clickhouse_type.replace("Nullable(", "")[:-1]
+ is_nullable = True
+
+ # TODO: remove when addressed https://github.com/ClickHouse/ClickHouse/issues/37594
+ if clickhouse_type.startswith("Array("):
+ clickhouse_type = remove_named_tuples(clickhouse_type)
+
+ if isinstance(type, dict):
+ column_invalid = not type.get("valid", True)
+ else:
+ column_invalid = False
+
+ if not column_invalid or (modifiers is not None and modifiers.s3TableUseInvalidColumns):
+ if is_nullable:
+ structure.append(f"`{column}` Nullable({clickhouse_type})")
+ else:
+ structure.append(f"`{column}` {clickhouse_type}")
+
+ fields[column] = get_hogql_field_for_column(column, type, clickhouse_type, is_nullable)
+
+ return fields, structure
+
+
class DataWarehouseTable(CreatedMetaFields, UpdatedMetaFields, UUIDTModel, DeletedMetaFields):
# loading external_data_source and credentials is easily N+1,
# so we have a custom object manager meaning people can't forget to load them
@@ -522,46 +609,6 @@ class DataWarehouseTable(CreatedMetaFields, UpdatedMetaFields, UUIDTModel, Delet
raise
return s3_table_func, placeholder_context
- def _get_hogql_field_for_column(
- self,
- column_name: str,
- column_definition: dict[str, Any] | str,
- clickhouse_type: str,
- is_nullable: bool,
- ) -> DatabaseField:
- if isinstance(column_definition, dict) and column_definition.get("hogql") == "StructDatabaseField":
- child_fields: dict[str, DatabaseField] = {}
- nested_definitions = column_definition.get("fields")
- if isinstance(nested_definitions, dict):
- for nested_name, nested_definition in nested_definitions.items():
- if not isinstance(nested_definition, dict):
- continue
-
- nested_clickhouse_type = str(nested_definition.get("clickhouse", "String"))
- nested_is_nullable = False
- if nested_clickhouse_type.startswith("Nullable("):
- nested_clickhouse_type = nested_clickhouse_type.replace("Nullable(", "")[:-1]
- nested_is_nullable = True
-
- child_fields[nested_name] = self._get_hogql_field_for_column(
- nested_name,
- nested_definition,
- nested_clickhouse_type,
- nested_is_nullable,
- )
-
- return StructDatabaseField(name=column_name, nullable=is_nullable, fields=child_fields)
-
- # Support for 'old' style columns
- if isinstance(column_definition, str):
- hogql_type_str = clickhouse_type.partition("(")[0]
- return CLICKHOUSE_HOGQL_MAPPING[hogql_type_str](name=column_name, nullable=is_nullable)
-
- return STR_TO_HOGQL_MAPPING.get(
- str(column_definition.get("hogql", "UnknownDatabaseField")),
- STR_TO_HOGQL_MAPPING["UnknownDatabaseField"],
- )(name=column_name, nullable=is_nullable)
-
def hogql_definition(
self, modifiers: Optional["HogQLQueryModifiers"] = None
) -> HogQLDataWarehouseTable | DirectPostgresTable | DirectMySQLTable | DirectSnowflakeTable | DirectRedshiftTable:
@@ -584,37 +631,7 @@ class DataWarehouseTable(CreatedMetaFields, UpdatedMetaFields, UUIDTModel, Delet
columns = self.columns or {}
- fields: dict[str, FieldOrTable] = {}
- structure = []
- for column, type in reconstruct_ordered_columns(columns, self.column_order):
- # Support for 'old' style columns
- if isinstance(type, str):
- clickhouse_type = type
- else:
- clickhouse_type = type["clickhouse"]
-
- is_nullable = False
-
- if clickhouse_type.startswith("Nullable("):
- clickhouse_type = clickhouse_type.replace("Nullable(", "")[:-1]
- is_nullable = True
-
- # TODO: remove when addressed https://github.com/ClickHouse/ClickHouse/issues/37594
- if clickhouse_type.startswith("Array("):
- clickhouse_type = remove_named_tuples(clickhouse_type)
-
- if isinstance(type, dict):
- column_invalid = not type.get("valid", True)
- else:
- column_invalid = False
-
- if not column_invalid or (modifiers is not None and modifiers.s3TableUseInvalidColumns):
- if is_nullable:
- structure.append(f"`{column}` Nullable({clickhouse_type})")
- else:
- structure.append(f"`{column}` {clickhouse_type}")
-
- fields[column] = self._get_hogql_field_for_column(column, type, clickhouse_type, is_nullable)
+ fields, structure = hogql_fields_and_structure_for_columns(columns, modifiers, column_order=self.column_order)
if self.external_data_source and self.external_data_source.is_direct_postgres:
postgres_catalog = (
diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.ts
index ead48854344d..7a3f9a8f4c0f 100644
--- a/products/warehouse_sources/frontend/generated/api.schemas.ts
+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts
@@ -1975,7 +1975,7 @@ 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. */
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean
/** Backend engine detected for the direct connection.
*
@@ -2818,7 +2818,7 @@ export interface ExternalDataSourceCreateApi {
* * `api` - api
* * `mcp` - mcp */
created_via?: ExternalDataSourceCreateCreatedViaEnumApi
- /** Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources. */
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources. */
direct_query_enabled?: boolean
}
@@ -2856,7 +2856,7 @@ 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. */
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean
/** Backend engine detected for the direct connection.
*
@@ -2983,6 +2983,777 @@ export interface ExternalDataSourceConnectionOptionApi {
* * `snowflake` - snowflake
* * `redshift` - redshift */
readonly engine: EngineEnumApi | null
+ /** The source type (e.g. 'Postgres', 'MySQL', 'Snowflake').
+ *
+ * * `Ashby` - Ashby
+ * * `Supabase` - Supabase
+ * * `CustomerIO` - CustomerIO
+ * * `Github` - Github
+ * * `Stripe` - Stripe
+ * * `Hubspot` - Hubspot
+ * * `Postgres` - Postgres
+ * * `Zendesk` - Zendesk
+ * * `Snowflake` - Snowflake
+ * * `Salesforce` - Salesforce
+ * * `MySQL` - MySQL
+ * * `MongoDB` - MongoDB
+ * * `MSSQL` - MSSQL
+ * * `Vitally` - Vitally
+ * * `BigQuery` - BigQuery
+ * * `Chargebee` - Chargebee
+ * * `Clerk` - Clerk
+ * * `GoogleAds` - GoogleAds
+ * * `GoogleSearchConsole` - GoogleSearchConsole
+ * * `TemporalIO` - TemporalIO
+ * * `DoIt` - DoIt
+ * * `GoogleSheets` - GoogleSheets
+ * * `MetaAds` - MetaAds
+ * * `Klaviyo` - Klaviyo
+ * * `Mailchimp` - Mailchimp
+ * * `Braze` - Braze
+ * * `Mailjet` - Mailjet
+ * * `Redshift` - Redshift
+ * * `Polar` - Polar
+ * * `RevenueCat` - RevenueCat
+ * * `LinkedinAds` - LinkedinAds
+ * * `RedditAds` - RedditAds
+ * * `TikTokAds` - TikTokAds
+ * * `BingAds` - BingAds
+ * * `Shopify` - Shopify
+ * * `Attio` - Attio
+ * * `SnapchatAds` - SnapchatAds
+ * * `Linear` - Linear
+ * * `Intercom` - Intercom
+ * * `Amplitude` - Amplitude
+ * * `Mixpanel` - Mixpanel
+ * * `Jira` - Jira
+ * * `ActiveCampaign` - ActiveCampaign
+ * * `Marketo` - Marketo
+ * * `Adjust` - Adjust
+ * * `AppsFlyer` - AppsFlyer
+ * * `Freshdesk` - Freshdesk
+ * * `GoogleAnalytics` - GoogleAnalytics
+ * * `Pipedrive` - Pipedrive
+ * * `SendGrid` - SendGrid
+ * * `Slack` - Slack
+ * * `PagerDuty` - PagerDuty
+ * * `Asana` - Asana
+ * * `Notion` - Notion
+ * * `Airtable` - Airtable
+ * * `Greenhouse` - Greenhouse
+ * * `BambooHR` - BambooHR
+ * * `Lever` - Lever
+ * * `GitLab` - GitLab
+ * * `Datadog` - Datadog
+ * * `Sentry` - Sentry
+ * * `Pendo` - Pendo
+ * * `FullStory` - FullStory
+ * * `AmazonAds` - AmazonAds
+ * * `PinterestAds` - PinterestAds
+ * * `AppleSearchAds` - AppleSearchAds
+ * * `QuickBooks` - QuickBooks
+ * * `Xero` - Xero
+ * * `NetSuite` - NetSuite
+ * * `WooCommerce` - WooCommerce
+ * * `BigCommerce` - BigCommerce
+ * * `PayPal` - PayPal
+ * * `Square` - Square
+ * * `Zoom` - Zoom
+ * * `Trello` - Trello
+ * * `Monday` - Monday
+ * * `ClickUp` - ClickUp
+ * * `Confluence` - Confluence
+ * * `Recurly` - Recurly
+ * * `SalesLoft` - SalesLoft
+ * * `Outreach` - Outreach
+ * * `Gong` - Gong
+ * * `Calendly` - Calendly
+ * * `Typeform` - Typeform
+ * * `Iterable` - Iterable
+ * * `ZohoCRM` - ZohoCRM
+ * * `Close` - Close
+ * * `Oracle` - Oracle
+ * * `DynamoDB` - DynamoDB
+ * * `Elasticsearch` - Elasticsearch
+ * * `Kafka` - Kafka
+ * * `LaunchDarkly` - LaunchDarkly
+ * * `Braintree` - Braintree
+ * * `Recharge` - Recharge
+ * * `HelpScout` - HelpScout
+ * * `Gorgias` - Gorgias
+ * * `Instagram` - Instagram
+ * * `YouTubeAnalytics` - YouTubeAnalytics
+ * * `FacebookPages` - FacebookPages
+ * * `TwitterAds` - TwitterAds
+ * * `Workday` - Workday
+ * * `ServiceNow` - ServiceNow
+ * * `Pardot` - Pardot
+ * * `Copper` - Copper
+ * * `Front` - Front
+ * * `ChartMogul` - ChartMogul
+ * * `Zuora` - Zuora
+ * * `Paddle` - Paddle
+ * * `CircleCI` - CircleCI
+ * * `CockroachDB` - CockroachDB
+ * * `Firebase` - Firebase
+ * * `AzureBlob` - AzureBlob
+ * * `GoogleDrive` - GoogleDrive
+ * * `OneDrive` - OneDrive
+ * * `SharePoint` - SharePoint
+ * * `Box` - Box
+ * * `SFTP` - SFTP
+ * * `MicrosoftTeams` - MicrosoftTeams
+ * * `Aircall` - Aircall
+ * * `Webflow` - Webflow
+ * * `Okta` - Okta
+ * * `Auth0` - Auth0
+ * * `Productboard` - Productboard
+ * * `Smartsheet` - Smartsheet
+ * * `Wrike` - Wrike
+ * * `Plaid` - Plaid
+ * * `SurveyMonkey` - SurveyMonkey
+ * * `Eventbrite` - Eventbrite
+ * * `RingCentral` - RingCentral
+ * * `Twilio` - Twilio
+ * * `Freshsales` - Freshsales
+ * * `Shortcut` - Shortcut
+ * * `ConvertKit` - ConvertKit
+ * * `Drip` - Drip
+ * * `CampaignMonitor` - CampaignMonitor
+ * * `MailerLite` - MailerLite
+ * * `Omnisend` - Omnisend
+ * * `Brevo` - Brevo
+ * * `Postmark` - Postmark
+ * * `Granola` - Granola
+ * * `BuildBetter` - BuildBetter
+ * * `Convex` - Convex
+ * * `ClickHouse` - ClickHouse
+ * * `Plain` - Plain
+ * * `Resend` - Resend
+ * * `PgAnalyze` - PgAnalyze
+ * * `WorkOS` - WorkOS
+ * * `AmazonS3` - AmazonS3
+ * * `GoogleCloudStorage` - GoogleCloudStorage
+ * * `Databricks` - Databricks
+ * * `Dynamics365` - Dynamics365
+ * * `SalesforceMarketingCloud` - SalesforceMarketingCloud
+ * * `Db2` - Db2
+ * * `Heap` - Heap
+ * * `AdobeAnalytics` - AdobeAnalytics
+ * * `Matomo` - Matomo
+ * * `Optimizely` - Optimizely
+ * * `Adyen` - Adyen
+ * * `GoCardless` - GoCardless
+ * * `Mollie` - Mollie
+ * * `CheckoutCom` - CheckoutCom
+ * * `Branch` - Branch
+ * * `Criteo` - Criteo
+ * * `Outbrain` - Outbrain
+ * * `Taboola` - Taboola
+ * * `AdRoll` - AdRoll
+ * * `DisplayVideo360` - DisplayVideo360
+ * * `GoogleAdManager` - GoogleAdManager
+ * * `CampaignManager360` - CampaignManager360
+ * * `SearchAds360` - SearchAds360
+ * * `AdobeCommerce` - AdobeCommerce
+ * * `AmazonSellingPartner` - AmazonSellingPartner
+ * * `Ebay` - Ebay
+ * * `Commercetools` - Commercetools
+ * * `LightspeedRetail` - LightspeedRetail
+ * * `ShipStation` - ShipStation
+ * * `ConstantContact` - ConstantContact
+ * * `Mailgun` - Mailgun
+ * * `Eloqua` - Eloqua
+ * * `Sailthru` - Sailthru
+ * * `Ortto` - Ortto
+ * * `Attentive` - Attentive
+ * * `Kustomer` - Kustomer
+ * * `Dixa` - Dixa
+ * * `Gladly` - Gladly
+ * * `Qualtrics` - Qualtrics
+ * * `Delighted` - Delighted
+ * * `AzureDevOps` - AzureDevOps
+ * * `Rollbar` - Rollbar
+ * * `Opsgenie` - Opsgenie
+ * * `IncidentIo` - IncidentIo
+ * * `Pingdom` - Pingdom
+ * * `Cloudflare` - Cloudflare
+ * * `CosmosDB` - CosmosDB
+ * * `PlanetScale` - PlanetScale
+ * * `SapHana` - SapHana
+ * * `Rippling` - Rippling
+ * * `HiBob` - HiBob
+ * * `Personio` - Personio
+ * * `Deel` - Deel
+ * * `AdpWorkforceNow` - AdpWorkforceNow
+ * * `Paylocity` - Paylocity
+ * * `Gusto` - Gusto
+ * * `CultureAmp` - CultureAmp
+ * * `Lattice` - Lattice
+ * * `SageIntacct` - SageIntacct
+ * * `FreshBooks` - FreshBooks
+ * * `Expensify` - Expensify
+ * * `Ramp` - Ramp
+ * * `Brex` - Brex
+ * * `Coupa` - Coupa
+ * * `SapConcur` - SapConcur
+ * * `Apollo` - Apollo
+ * * `Crunchbase` - Crunchbase
+ * * `ZoomInfo` - ZoomInfo
+ * * `Clari` - Clari
+ * * `Chorus` - Chorus
+ * * `Coda` - Coda
+ * * `Guru` - Guru
+ * * `Dropbox` - Dropbox
+ * * `Docusign` - Docusign
+ * * `PandaDoc` - PandaDoc
+ * * `SapErp` - SapErp
+ * * `SapSuccessFactors` - SapSuccessFactors
+ * * `OracleEbs` - OracleEbs
+ * * `OracleFusion` - OracleFusion
+ * * `AmazonSNS` - AmazonSNS
+ * * `AmazonEventBridge` - AmazonEventBridge
+ * * `AmazonSQS` - AmazonSQS
+ * * `AmazonKinesis` - AmazonKinesis
+ * * `AmazonCloudWatch` - AmazonCloudWatch
+ * * `OpenAIAds` - OpenAIAds
+ * * `OneHundredMs` - OneHundredMs
+ * * `SevenShifts` - SevenShifts
+ * * `AcuityScheduling` - AcuityScheduling
+ * * `AgileCRM` - AgileCRM
+ * * `Aha` - Aha
+ * * `Airbyte` - Airbyte
+ * * `Akeneo` - Akeneo
+ * * `Algolia` - Algolia
+ * * `AlpacaBrokerAPI` - AlpacaBrokerAPI
+ * * `ApifyDataset` - ApifyDataset
+ * * `Appcues` - Appcues
+ * * `Appfigures` - Appfigures
+ * * `Appfollow` - Appfollow
+ * * `Apptivo` - Apptivo
+ * * `AssemblyAI` - AssemblyAI
+ * * `Awin` - Awin
+ * * `AwsCloudTrail` - AwsCloudTrail
+ * * `AzureTableStorage` - AzureTableStorage
+ * * `Babelforce` - Babelforce
+ * * `Basecamp` - Basecamp
+ * * `Beamer` - Beamer
+ * * `BigMailer` - BigMailer
+ * * `Bluetally` - Bluetally
+ * * `BoldSign` - BoldSign
+ * * `BreezyHR` - BreezyHR
+ * * `Bugsnag` - Bugsnag
+ * * `Buildkite` - Buildkite
+ * * `Bunny` - Bunny
+ * * `Buzzsprout` - Buzzsprout
+ * * `CalCom` - CalCom
+ * * `CallRail` - CallRail
+ * * `Campayn` - Campayn
+ * * `Canny` - Canny
+ * * `CapsuleCRM` - CapsuleCRM
+ * * `CaptainData` - CaptainData
+ * * `CartCom` - CartCom
+ * * `CastorEDC` - CastorEDC
+ * * `Chameleon` - Chameleon
+ * * `Chargedesk` - Chargedesk
+ * * `Chargify` - Chargify
+ * * `Chift` - Chift
+ * * `Churnkey` - Churnkey
+ * * `Cin7` - Cin7
+ * * `CiscoMeraki` - CiscoMeraki
+ * * `Clazar` - Clazar
+ * * `Clockify` - Clockify
+ * * `Clockodo` - Clockodo
+ * * `Cloudbeds` - Cloudbeds
+ * * `Coassemble` - Coassemble
+ * * `Codefresh` - Codefresh
+ * * `Concord` - Concord
+ * * `ConfigCat` - ConfigCat
+ * * `Couchbase` - Couchbase
+ * * `Curve` - Curve
+ * * `Customerly` - Customerly
+ * * `Datascope` - Datascope
+ * * `Dbt` - Dbt
+ * * `Deputy` - Deputy
+ * * `DevinAI` - DevinAI
+ * * `Docuseal` - Docuseal
+ * * `Dolibarr` - Dolibarr
+ * * `Dremio` - Dremio
+ * * `DropboxSign` - DropboxSign
+ * * `Dwolla` - Dwolla
+ * * `EConomic` - EConomic
+ * * `Easypost` - Easypost
+ * * `Easypromos` - Easypromos
+ * * `Elasticemail` - Elasticemail
+ * * `EmailOctopus` - EmailOctopus
+ * * `EmploymentHero` - EmploymentHero
+ * * `Encharge` - Encharge
+ * * `Eventee` - Eventee
+ * * `Eventzilla` - Eventzilla
+ * * `Everhour` - Everhour
+ * * `EZOfficeInventory` - EZOfficeInventory
+ * * `Factorial` - Factorial
+ * * `Fastbill` - Fastbill
+ * * `Fastly` - Fastly
+ * * `Fauna` - Fauna
+ * * `Feishu` - Feishu
+ * * `Fillout` - Fillout
+ * * `Finage` - Finage
+ * * `Firebolt` - Firebolt
+ * * `FireHydrant` - FireHydrant
+ * * `Fleetio` - Fleetio
+ * * `Flexmail` - Flexmail
+ * * `Flexport` - Flexport
+ * * `FloatApp` - FloatApp
+ * * `Flowlu` - Flowlu
+ * * `Formbricks` - Formbricks
+ * * `FreeAgent` - FreeAgent
+ * * `Freightview` - Freightview
+ * * `Freshcaller` - Freshcaller
+ * * `Freshchat` - Freshchat
+ * * `Freshservice` - Freshservice
+ * * `Fulcrum` - Fulcrum
+ * * `GainsightPx` - GainsightPx
+ * * `GitBook` - GitBook
+ * * `Glassfrog` - Glassfrog
+ * * `Goldcast` - Goldcast
+ * * `GoLogin` - GoLogin
+ * * `Grafana` - Grafana
+ * * `GreytHr` - GreytHr
+ * * `Gridly` - Gridly
+ * * `Harness` - Harness
+ * * `Height` - Height
+ * * `Hellobaton` - Hellobaton
+ * * `HighLevel` - HighLevel
+ * * `HoorayHR` - HoorayHR
+ * * `Hubplanner` - Hubplanner
+ * * `Humanitix` - Humanitix
+ * * `Huntr` - Huntr
+ * * `Inflowinventory` - Inflowinventory
+ * * `InforNexus` - InforNexus
+ * * `Insightful` - Insightful
+ * * `Insightly` - Insightly
+ * * `Instantly` - Instantly
+ * * `Instatus` - Instatus
+ * * `Intruder` - Intruder
+ * * `Invoiced` - Invoiced
+ * * `Invoiceninja` - Invoiceninja
+ * * `JamfPro` - JamfPro
+ * * `JobNimbus` - JobNimbus
+ * * `Jotform` - Jotform
+ * * `JudgeMeReviews` - JudgeMeReviews
+ * * `JustCall` - JustCall
+ * * `JustSift` - JustSift
+ * * `K6Cloud` - K6Cloud
+ * * `Katana` - Katana
+ * * `Keka` - Keka
+ * * `Kisi` - Kisi
+ * * `Kissmetrics` - Kissmetrics
+ * * `Klarna` - Klarna
+ * * `Klaus` - Klaus
+ * * `Lago` - Lago
+ * * `Leadfeeder` - Leadfeeder
+ * * `Lemlist` - Lemlist
+ * * `LessAnnoyingCRM` - LessAnnoyingCRM
+ * * `LinkedinPages` - LinkedinPages
+ * * `Linkrunner` - Linkrunner
+ * * `Linnworks` - Linnworks
+ * * `Lob` - Lob
+ * * `Lokalise` - Lokalise
+ * * `Looker` - Looker
+ * * `Luma` - Luma
+ * * `MailerSend` - MailerSend
+ * * `Mailosaur` - Mailosaur
+ * * `Mailtrap` - Mailtrap
+ * * `Mantle` - Mantle
+ * * `Mention` - Mention
+ * * `MercadoAds` - MercadoAds
+ * * `Merge` - Merge
+ * * `Metabase` - Metabase
+ * * `Metricool` - Metricool
+ * * `MicrosoftDataverse` - MicrosoftDataverse
+ * * `MicrosoftEntraId` - MicrosoftEntraId
+ * * `MicrosoftLists` - MicrosoftLists
+ * * `Miro` - Miro
+ * * `Missive` - Missive
+ * * `MixMax` - MixMax
+ * * `Mode` - Mode
+ * * `Mux` - Mux
+ * * `MyHours` - MyHours
+ * * `N8n` - N8n
+ * * `Navan` - Navan
+ * * `NebiusAI` - NebiusAI
+ * * `Nexiopay` - Nexiopay
+ * * `NinjaOneRMM` - NinjaOneRMM
+ * * `NoCRM` - NoCRM
+ * * `NorthpassLMS` - NorthpassLMS
+ * * `Nutshell` - Nutshell
+ * * `Nylas` - Nylas
+ * * `Oncehub` - Oncehub
+ * * `Onepagecrm` - Onepagecrm
+ * * `OneSignal` - OneSignal
+ * * `Onfleet` - Onfleet
+ * * `OpinionStage` - OpinionStage
+ * * `OPUSWatch` - OPUSWatch
+ * * `Orb` - Orb
+ * * `Orbit` - Orbit
+ * * `Oura` - Oura
+ * * `Oveit` - Oveit
+ * * `PabblySubscriptionsBilling` - PabblySubscriptionsBilling
+ * * `Paperform` - Paperform
+ * * `Papersign` - Papersign
+ * * `Partnerize` - Partnerize
+ * * `PartnerStack` - PartnerStack
+ * * `PayFit` - PayFit
+ * * `Paystack` - Paystack
+ * * `Pennylane` - Pennylane
+ * * `Perk` - Perk
+ * * `PersistIq` - PersistIq
+ * * `Persona` - Persona
+ * * `Phyllo` - Phyllo
+ * * `Picqer` - Picqer
+ * * `Pipeliner` - Pipeliner
+ * * `PivotalTracker` - PivotalTracker
+ * * `Piwik` - Piwik
+ * * `Planhat` - Planhat
+ * * `Plausible` - Plausible
+ * * `Poplar` - Poplar
+ * * `PrestaShop` - PrestaShop
+ * * `Pretix` - Pretix
+ * * `Primetric` - Primetric
+ * * `Printify` - Printify
+ * * `Productive` - Productive
+ * * `Pylon` - Pylon
+ * * `Qonto` - Qonto
+ * * `Qualaroo` - Qualaroo
+ * * `Railz` - Railz
+ * * `RDStationMarketing` - RDStationMarketing
+ * * `Recruitee` - Recruitee
+ * * `Reddit` - Reddit
+ * * `ReferralHero` - ReferralHero
+ * * `RentCast` - RentCast
+ * * `Repairshopr` - Repairshopr
+ * * `ReplyIo` - ReplyIo
+ * * `RetailExpress` - RetailExpress
+ * * `Retently` - Retently
+ * * `RevolutMerchant` - RevolutMerchant
+ * * `RocketChat` - RocketChat
+ * * `Rocketlane` - Rocketlane
+ * * `Rootly` - Rootly
+ * * `Ruddr` - Ruddr
+ * * `SafetyCulture` - SafetyCulture
+ * * `SageHR` - SageHR
+ * * `Salesflare` - Salesflare
+ * * `SAPFieldglass` - SAPFieldglass
+ * * `SavvyCal` - SavvyCal
+ * * `Secoda` - Secoda
+ * * `Segment` - Segment
+ * * `Sendowl` - Sendowl
+ * * `SendPulse` - SendPulse
+ * * `Senseforce` - Senseforce
+ * * `Serpstat` - Serpstat
+ * * `Sharetribe` - Sharetribe
+ * * `Shippo` - Shippo
+ * * `ShopWired` - ShopWired
+ * * `Shortio` - Shortio
+ * * `Shutterstock` - Shutterstock
+ * * `SigmaComputing` - SigmaComputing
+ * * `SignNow` - SignNow
+ * * `SimpleCast` - SimpleCast
+ * * `Simplesat` - Simplesat
+ * * `Smaily` - Smaily
+ * * `SmartEngage` - SmartEngage
+ * * `Smartreach` - Smartreach
+ * * `Smartwaiver` - Smartwaiver
+ * * `SolarwindsServiceDesk` - SolarwindsServiceDesk
+ * * `SonarCloud` - SonarCloud
+ * * `SparkPost` - SparkPost
+ * * `SplitIo` - SplitIo
+ * * `SpotifyAds` - SpotifyAds
+ * * `SpotlerCRM` - SpotlerCRM
+ * * `Squarespace` - Squarespace
+ * * `Statsig` - Statsig
+ * * `Statuspage` - Statuspage
+ * * `Stigg` - Stigg
+ * * `Strava` - Strava
+ * * `SurveySparrow` - SurveySparrow
+ * * `Survicate` - Survicate
+ * * `Svix` - Svix
+ * * `Systeme` - Systeme
+ * * `Tavus` - Tavus
+ * * `Teamtailor` - Teamtailor
+ * * `Teamwork` - Teamwork
+ * * `Tempo` - Tempo
+ * * `Testrail` - Testrail
+ * * `Thinkific` - Thinkific
+ * * `ThinkificCourses` - ThinkificCourses
+ * * `ThriveLearning` - ThriveLearning
+ * * `Ticketmaster` - Ticketmaster
+ * * `TicketTailor` - TicketTailor
+ * * `TickTick` - TickTick
+ * * `Timely` - Timely
+ * * `Tinyemail` - Tinyemail
+ * * `Todoist` - Todoist
+ * * `Toggl` - Toggl
+ * * `TrackPMS` - TrackPMS
+ * * `Tremendous` - Tremendous
+ * * `TrustPilot` - TrustPilot
+ * * `Twitter` - Twitter
+ * * `TyntecSMS` - TyntecSMS
+ * * `Unleash` - Unleash
+ * * `UpPromote` - UpPromote
+ * * `Uptick` - Uptick
+ * * `Uservoice` - Uservoice
+ * * `Vantage` - Vantage
+ * * `Veeqo` - Veeqo
+ * * `Vercel` - Vercel
+ * * `VismaEconomic` - VismaEconomic
+ * * `VWO` - VWO
+ * * `Waiteraid` - Waiteraid
+ * * `Wasabi` - Wasabi
+ * * `WhenIWork` - WhenIWork
+ * * `Wordpress` - Wordpress
+ * * `Workable` - Workable
+ * * `Workflowmax` - Workflowmax
+ * * `Workramp` - Workramp
+ * * `Wufoo` - Wufoo
+ * * `Xsolla` - Xsolla
+ * * `YandexMetrica` - YandexMetrica
+ * * `Yotpo` - Yotpo
+ * * `Ynab` - Ynab
+ * * `Younium` - Younium
+ * * `YouSign` - YouSign
+ * * `YoutubeData` - YoutubeData
+ * * `ZapierSupportedStorage` - ZapierSupportedStorage
+ * * `ZapSign` - ZapSign
+ * * `ZendeskSell` - ZendeskSell
+ * * `ZendeskSunshine` - ZendeskSunshine
+ * * `Zenefits` - Zenefits
+ * * `Zenloop` - Zenloop
+ * * `ZohoAnalytics` - ZohoAnalytics
+ * * `ZohoBigin` - ZohoBigin
+ * * `ZohoBilling` - ZohoBilling
+ * * `ZohoBooks` - ZohoBooks
+ * * `ZohoCampaign` - ZohoCampaign
+ * * `ZohoDesk` - ZohoDesk
+ * * `ZohoExpense` - ZohoExpense
+ * * `ZohoInventory` - ZohoInventory
+ * * `ZohoInvoice` - ZohoInvoice
+ * * `ZonkaFeedback` - ZonkaFeedback
+ * * `AlphaVantage` - AlphaVantage
+ * * `Aviationstack` - Aviationstack
+ * * `Bitly` - Bitly
+ * * `Blogger` - Blogger
+ * * `Breezometer` - Breezometer
+ * * `CareQualityCommission` - CareQualityCommission
+ * * `Cimis` - Cimis
+ * * `CoinApi` - CoinApi
+ * * `CoinGecko` - CoinGecko
+ * * `CoinMarketCap` - CoinMarketCap
+ * * `DingConnect` - DingConnect
+ * * `Dockerhub` - Dockerhub
+ * * `ExchangeRatesApi` - ExchangeRatesApi
+ * * `FinancialModelling` - FinancialModelling
+ * * `Finnhub` - Finnhub
+ * * `Finnworlds` - Finnworlds
+ * * `Giphy` - Giphy
+ * * `Gmail` - Gmail
+ * * `GNews` - GNews
+ * * `GoogleCalendar` - GoogleCalendar
+ * * `GoogleClassroom` - GoogleClassroom
+ * * `GoogleDirectory` - GoogleDirectory
+ * * `GoogleForms` - GoogleForms
+ * * `GooglePageSpeedInsights` - GooglePageSpeedInsights
+ * * `GoogleTasks` - GoogleTasks
+ * * `GoogleWebfonts` - GoogleWebfonts
+ * * `GoogleWorkspaceAdminReports` - GoogleWorkspaceAdminReports
+ * * `HuggingFace` - HuggingFace
+ * * `IlluminaBasespace` - IlluminaBasespace
+ * * `Imagga` - Imagga
+ * * `Interzoid` - Interzoid
+ * * `IP2Whois` - IP2Whois
+ * * `KYVE` - KYVE
+ * * `Marketstack` - Marketstack
+ * * `Mendeley` - Mendeley
+ * * `Nasa` - Nasa
+ * * `NewYorkTimes` - NewYorkTimes
+ * * `NewsApi` - NewsApi
+ * * `NewsData` - NewsData
+ * * `OpenDataDc` - OpenDataDc
+ * * `OpenExchangeRates` - OpenExchangeRates
+ * * `OpenAQ` - OpenAQ
+ * * `OpenFDA` - OpenFDA
+ * * `OpenWeather` - OpenWeather
+ * * `Outlook` - Outlook
+ * * `Perigon` - Perigon
+ * * `Pexels` - Pexels
+ * * `Pocket` - Pocket
+ * * `Polygon` - Polygon
+ * * `PyPI` - PyPI
+ * * `Recreation` - Recreation
+ * * `RKICovid` - RKICovid
+ * * `Rss` - Rss
+ * * `SimFin` - SimFin
+ * * `StockData` - StockData
+ * * `Guardian` - Guardian
+ * * `TMDb` - TMDb
+ * * `TVMaze` - TVMaze
+ * * `TwelveData` - TwelveData
+ * * `Ubidots` - Ubidots
+ * * `USCensus` - USCensus
+ * * `Watchmode` - Watchmode
+ * * `WikipediaPageviews` - WikipediaPageviews
+ * * `YahooFinance` - YahooFinance
+ * * `Clarifai` - Clarifai
+ * * `Adapty` - Adapty
+ * * `Braintrust` - Braintrust
+ * * `StreamElements` - StreamElements
+ * * `Streamlabs` - Streamlabs
+ * * `Datorama` - Datorama
+ * * `Ahrefs` - Ahrefs
+ * * `Lightfield` - Lightfield
+ * * `Appstack` - Appstack
+ * * `Razorpay` - Razorpay
+ * * `Neon` - Neon
+ * * `NewRelic` - NewRelic
+ * * `Custom` - Custom
+ * * `Tile38` - Tile38
+ * * `Chatwoot` - Chatwoot
+ * * `Sanity` - Sanity
+ * * `Metronome` - Metronome
+ * * `Jobber` - Jobber
+ * * `Knock` - Knock
+ * * `Leexi` - Leexi
+ * * `RB2B` - RB2B
+ * * `Superwall` - Superwall
+ * * `Liana` - Liana
+ * * `TawkTo` - TawkTo
+ * * `Hightouch` - Hightouch
+ * * `LemonSqueezy` - LemonSqueezy
+ * * `Ikas` - Ikas
+ * * `Talkwalker` - Talkwalker
+ * * `NextdoorAds` - NextdoorAds
+ * * `AppLovin` - AppLovin
+ * * `Baserow` - Baserow
+ * * `Plunk` - Plunk
+ * * `Dub` - Dub
+ * * `AirOps` - AirOps
+ * * `Podium` - Podium
+ * * `Loops` - Loops
+ * * `Redis` - Redis
+ * * `Mercury` - Mercury
+ * * `Gojiberry` - Gojiberry
+ * * `Teachable` - Teachable
+ * * `PeecAI` - PeecAI
+ * * `Healthchecks` - Healthchecks
+ * * `Impact` - Impact
+ * * `AikidoSecurity` - AikidoSecurity
+ * * `Alguna` - Alguna
+ * * `Anthropic` - Anthropic
+ * * `Appwrite` - Appwrite
+ * * `BlandAI` - BlandAI
+ * * `BrowseAI` - BrowseAI
+ * * `BrowserUse` - BrowserUse
+ * * `ChartHop` - ChartHop
+ * * `Cody` - Cody
+ * * `Cursor` - Cursor
+ * * `Decagon` - Decagon
+ * * `Deepgram` - Deepgram
+ * * `ElevenLabs` - ElevenLabs
+ * * `Harvey` - Harvey
+ * * `Hyperspell` - Hyperspell
+ * * `Langfuse` - Langfuse
+ * * `LingoDev` - LingoDev
+ * * `M3ter` - M3ter
+ * * `Maxio` - Maxio
+ * * `Metorial` - Metorial
+ * * `OpenRouter` - OpenRouter
+ * * `TogetherAI` - TogetherAI
+ * * `Vapi` - Vapi
+ * * `Vespa` - Vespa
+ * * `Writesonic` - Writesonic
+ * * `Aiven` - Aiven
+ * * `Aviator` - Aviator
+ * * `Backblaze` - Backblaze
+ * * `Baseten` - Baseten
+ * * `Browserbase` - Browserbase
+ * * `Cohere` - Cohere
+ * * `DenoDeploy` - DenoDeploy
+ * * `DigitalOcean` - DigitalOcean
+ * * `E2B` - E2B
+ * * `Fintoc` - Fintoc
+ * * `Firecrawl` - Firecrawl
+ * * `FireworksAI` - FireworksAI
+ * * `FlyIo` - FlyIo
+ * * `Groq` - Groq
+ * * `GrowthBook` - GrowthBook
+ * * `Gumloop` - Gumloop
+ * * `Hatchet` - Hatchet
+ * * `Helicone` - Helicone
+ * * `Heroku` - Heroku
+ * * `Hetzner` - Hetzner
+ * * `HeyGen` - HeyGen
+ * * `Infisical` - Infisical
+ * * `Inngest` - Inngest
+ * * `KapaAI` - KapaAI
+ * * `Kernel` - Kernel
+ * * `Koyeb` - Koyeb
+ * * `LambdaLabs` - LambdaLabs
+ * * `LangSmith` - LangSmith
+ * * `Linode` - Linode
+ * * `LlamaCloud` - LlamaCloud
+ * * `Mem0` - Mem0
+ * * `Metriport` - Metriport
+ * * `Mintlify` - Mintlify
+ * * `MistralAI` - MistralAI
+ * * `Mono` - Mono
+ * * `Netlify` - Netlify
+ * * `Northflank` - Northflank
+ * * `OpenAI` - OpenAI
+ * * `Pinecone` - Pinecone
+ * * `PlatformSh` - PlatformSh
+ * * `PromptingCompany` - PromptingCompany
+ * * `Qdrant` - Qdrant
+ * * `Render` - Render
+ * * `Replicate` - Replicate
+ * * `RetellAI` - RetellAI
+ * * `Roark` - Roark
+ * * `RunPod` - RunPod
+ * * `ScaleAI` - ScaleAI
+ * * `Scaleway` - Scaleway
+ * * `SigNoz` - SigNoz
+ * * `Sim` - Sim
+ * * `Skyvern` - Skyvern
+ * * `Slash` - Slash
+ * * `Synthesia` - Synthesia
+ * * `Telli` - Telli
+ * * `TerraApi` - TerraApi
+ * * `TriggerDev` - TriggerDev
+ * * `Turso` - Turso
+ * * `Singular` - Singular
+ * * `Swonkie` - Swonkie
+ * * `TwelveLabs` - TwelveLabs
+ * * `Twenty` - Twenty
+ * * `Unstructured` - Unstructured
+ * * `Upstash` - Upstash
+ * * `Vellum` - Vellum
+ * * `Vultr` - Vultr
+ * * `Windmill` - Windmill
+ * * `Zep` - Zep
+ * * `Hex` - Hex
+ * * `Sumsub` - Sumsub
+ * * `GoogleChat` - GoogleChat
+ * * `Kickscale` - Kickscale
+ * * `Zellify` - Zellify
+ * * `RudderStack` - RudderStack */
+ readonly source_type: ExternalDataSourceTypeEnumApi
+ /** 'direct' for pure live-query sources; 'warehouse' for synced sources with direct query enabled.
+ *
+ * * `warehouse` - warehouse
+ * * `direct` - direct */
+ readonly access_method: AccessMethodEnumApi
+ /** Whether HogQL queries compile for this connection. When false, only raw SQL (sendRawQuery) works. */
+ readonly supports_hogql: boolean
}
export interface PaginatedExternalDataSourceConnectionOptionListApi {
@@ -5440,7 +6211,7 @@ 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. */
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources. */
direct_query_enabled?: boolean
}
diff --git a/products/warehouse_sources/frontend/generated/api.zod.ts b/products/warehouse_sources/frontend/generated/api.zod.ts
index d6ed8c49b69f..53845d5649b1 100644
--- a/products/warehouse_sources/frontend/generated/api.zod.ts
+++ b/products/warehouse_sources/frontend/generated/api.zod.ts
@@ -732,7 +732,7 @@ export const externalDataSourcesCreateBodyDescriptionMax = 400
export const externalDataSourcesCreateBodyAccessMethodDefault = `warehouse`
export const externalDataSourcesCreateBodyCreatedViaDefault = `api`
-export const externalDataSourcesCreateBodyDirectQueryEnabledDefault = true
+export const externalDataSourcesCreateBodyDirectQueryEnabledDefault = false
export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
@@ -1532,7 +1532,7 @@ export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
.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.'
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources.'
),
})
@@ -1564,7 +1564,7 @@ export const ExternalDataSourcesUpdateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1598,7 +1598,7 @@ export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1708,7 +1708,7 @@ export const ExternalDataSourcesCheckCdcPrerequisitesForSourceCreateBody = /* @_
.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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1742,7 +1742,7 @@ export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1776,7 +1776,7 @@ export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1817,7 +1817,7 @@ export const ExternalDataSourcesDisableCdcCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1862,7 +1862,7 @@ export const ExternalDataSourcesEnableCdcCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1896,7 +1896,7 @@ export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1930,7 +1930,7 @@ export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1967,7 +1967,7 @@ export const ExternalDataSourcesRevenueAnalyticsConfigPartialUpdateBody = /* @__
.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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -2006,7 +2006,7 @@ export const ExternalDataSourcesUpdateCdcSettingsCreateBody = /* @__PURE__ */ zo
.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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -2040,7 +2040,7 @@ export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */
.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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -3672,7 +3672,7 @@ export const externalDataSourcesSetupCreateBodyPrefixMax = 100
export const externalDataSourcesSetupCreateBodyDescriptionMax = 400
-export const externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault = true
+export const externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault = false
export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
@@ -4465,7 +4465,7 @@ export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
.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.'
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources.'
),
})
@@ -4497,7 +4497,7 @@ export const ExternalDataSourcesSourcePrefixCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 9ac976fa071b..92c0dee60f44 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -4344,7 +4344,7 @@ export namespace Schemas {
export type HogQLQueryVariables = {[key: string]: HogQLVariable} | null;
export interface HogQLQuery {
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string | null;
explain?: boolean | null;
filters?: HogQLFilters | null;
@@ -16202,7 +16202,8 @@ export namespace Schemas {
export interface DatabaseSchemaDataWarehouseTable {
fields: DatabaseSchemaDataWarehouseTableFields;
- format: string;
+ /** Absent for a dual-mode source's virtual tables, which have no synced S3 backing. */
+ format?: string | null;
id: string;
name: string;
row_count?: number | null;
@@ -16211,7 +16212,8 @@ export namespace Schemas {
search_aliases?: string[] | null;
source?: DatabaseSchemaSource | null;
type?: 'data_warehouse';
- url_pattern: string;
+ /** Absent for a dual-mode source's virtual tables, which have no synced S3 backing. */
+ url_pattern?: string | null;
}
export type DatabaseSchemaEndpointTableFields = {[key: string]: DatabaseSchemaField};
@@ -24316,6 +24318,777 @@ export namespace Schemas {
* * `snowflake` - snowflake
* * `redshift` - redshift */
readonly engine: EngineEnum | null;
+ /** The source type (e.g. 'Postgres', 'MySQL', 'Snowflake').
+ *
+ * * `Ashby` - Ashby
+ * * `Supabase` - Supabase
+ * * `CustomerIO` - CustomerIO
+ * * `Github` - Github
+ * * `Stripe` - Stripe
+ * * `Hubspot` - Hubspot
+ * * `Postgres` - Postgres
+ * * `Zendesk` - Zendesk
+ * * `Snowflake` - Snowflake
+ * * `Salesforce` - Salesforce
+ * * `MySQL` - MySQL
+ * * `MongoDB` - MongoDB
+ * * `MSSQL` - MSSQL
+ * * `Vitally` - Vitally
+ * * `BigQuery` - BigQuery
+ * * `Chargebee` - Chargebee
+ * * `Clerk` - Clerk
+ * * `GoogleAds` - GoogleAds
+ * * `GoogleSearchConsole` - GoogleSearchConsole
+ * * `TemporalIO` - TemporalIO
+ * * `DoIt` - DoIt
+ * * `GoogleSheets` - GoogleSheets
+ * * `MetaAds` - MetaAds
+ * * `Klaviyo` - Klaviyo
+ * * `Mailchimp` - Mailchimp
+ * * `Braze` - Braze
+ * * `Mailjet` - Mailjet
+ * * `Redshift` - Redshift
+ * * `Polar` - Polar
+ * * `RevenueCat` - RevenueCat
+ * * `LinkedinAds` - LinkedinAds
+ * * `RedditAds` - RedditAds
+ * * `TikTokAds` - TikTokAds
+ * * `BingAds` - BingAds
+ * * `Shopify` - Shopify
+ * * `Attio` - Attio
+ * * `SnapchatAds` - SnapchatAds
+ * * `Linear` - Linear
+ * * `Intercom` - Intercom
+ * * `Amplitude` - Amplitude
+ * * `Mixpanel` - Mixpanel
+ * * `Jira` - Jira
+ * * `ActiveCampaign` - ActiveCampaign
+ * * `Marketo` - Marketo
+ * * `Adjust` - Adjust
+ * * `AppsFlyer` - AppsFlyer
+ * * `Freshdesk` - Freshdesk
+ * * `GoogleAnalytics` - GoogleAnalytics
+ * * `Pipedrive` - Pipedrive
+ * * `SendGrid` - SendGrid
+ * * `Slack` - Slack
+ * * `PagerDuty` - PagerDuty
+ * * `Asana` - Asana
+ * * `Notion` - Notion
+ * * `Airtable` - Airtable
+ * * `Greenhouse` - Greenhouse
+ * * `BambooHR` - BambooHR
+ * * `Lever` - Lever
+ * * `GitLab` - GitLab
+ * * `Datadog` - Datadog
+ * * `Sentry` - Sentry
+ * * `Pendo` - Pendo
+ * * `FullStory` - FullStory
+ * * `AmazonAds` - AmazonAds
+ * * `PinterestAds` - PinterestAds
+ * * `AppleSearchAds` - AppleSearchAds
+ * * `QuickBooks` - QuickBooks
+ * * `Xero` - Xero
+ * * `NetSuite` - NetSuite
+ * * `WooCommerce` - WooCommerce
+ * * `BigCommerce` - BigCommerce
+ * * `PayPal` - PayPal
+ * * `Square` - Square
+ * * `Zoom` - Zoom
+ * * `Trello` - Trello
+ * * `Monday` - Monday
+ * * `ClickUp` - ClickUp
+ * * `Confluence` - Confluence
+ * * `Recurly` - Recurly
+ * * `SalesLoft` - SalesLoft
+ * * `Outreach` - Outreach
+ * * `Gong` - Gong
+ * * `Calendly` - Calendly
+ * * `Typeform` - Typeform
+ * * `Iterable` - Iterable
+ * * `ZohoCRM` - ZohoCRM
+ * * `Close` - Close
+ * * `Oracle` - Oracle
+ * * `DynamoDB` - DynamoDB
+ * * `Elasticsearch` - Elasticsearch
+ * * `Kafka` - Kafka
+ * * `LaunchDarkly` - LaunchDarkly
+ * * `Braintree` - Braintree
+ * * `Recharge` - Recharge
+ * * `HelpScout` - HelpScout
+ * * `Gorgias` - Gorgias
+ * * `Instagram` - Instagram
+ * * `YouTubeAnalytics` - YouTubeAnalytics
+ * * `FacebookPages` - FacebookPages
+ * * `TwitterAds` - TwitterAds
+ * * `Workday` - Workday
+ * * `ServiceNow` - ServiceNow
+ * * `Pardot` - Pardot
+ * * `Copper` - Copper
+ * * `Front` - Front
+ * * `ChartMogul` - ChartMogul
+ * * `Zuora` - Zuora
+ * * `Paddle` - Paddle
+ * * `CircleCI` - CircleCI
+ * * `CockroachDB` - CockroachDB
+ * * `Firebase` - Firebase
+ * * `AzureBlob` - AzureBlob
+ * * `GoogleDrive` - GoogleDrive
+ * * `OneDrive` - OneDrive
+ * * `SharePoint` - SharePoint
+ * * `Box` - Box
+ * * `SFTP` - SFTP
+ * * `MicrosoftTeams` - MicrosoftTeams
+ * * `Aircall` - Aircall
+ * * `Webflow` - Webflow
+ * * `Okta` - Okta
+ * * `Auth0` - Auth0
+ * * `Productboard` - Productboard
+ * * `Smartsheet` - Smartsheet
+ * * `Wrike` - Wrike
+ * * `Plaid` - Plaid
+ * * `SurveyMonkey` - SurveyMonkey
+ * * `Eventbrite` - Eventbrite
+ * * `RingCentral` - RingCentral
+ * * `Twilio` - Twilio
+ * * `Freshsales` - Freshsales
+ * * `Shortcut` - Shortcut
+ * * `ConvertKit` - ConvertKit
+ * * `Drip` - Drip
+ * * `CampaignMonitor` - CampaignMonitor
+ * * `MailerLite` - MailerLite
+ * * `Omnisend` - Omnisend
+ * * `Brevo` - Brevo
+ * * `Postmark` - Postmark
+ * * `Granola` - Granola
+ * * `BuildBetter` - BuildBetter
+ * * `Convex` - Convex
+ * * `ClickHouse` - ClickHouse
+ * * `Plain` - Plain
+ * * `Resend` - Resend
+ * * `PgAnalyze` - PgAnalyze
+ * * `WorkOS` - WorkOS
+ * * `AmazonS3` - AmazonS3
+ * * `GoogleCloudStorage` - GoogleCloudStorage
+ * * `Databricks` - Databricks
+ * * `Dynamics365` - Dynamics365
+ * * `SalesforceMarketingCloud` - SalesforceMarketingCloud
+ * * `Db2` - Db2
+ * * `Heap` - Heap
+ * * `AdobeAnalytics` - AdobeAnalytics
+ * * `Matomo` - Matomo
+ * * `Optimizely` - Optimizely
+ * * `Adyen` - Adyen
+ * * `GoCardless` - GoCardless
+ * * `Mollie` - Mollie
+ * * `CheckoutCom` - CheckoutCom
+ * * `Branch` - Branch
+ * * `Criteo` - Criteo
+ * * `Outbrain` - Outbrain
+ * * `Taboola` - Taboola
+ * * `AdRoll` - AdRoll
+ * * `DisplayVideo360` - DisplayVideo360
+ * * `GoogleAdManager` - GoogleAdManager
+ * * `CampaignManager360` - CampaignManager360
+ * * `SearchAds360` - SearchAds360
+ * * `AdobeCommerce` - AdobeCommerce
+ * * `AmazonSellingPartner` - AmazonSellingPartner
+ * * `Ebay` - Ebay
+ * * `Commercetools` - Commercetools
+ * * `LightspeedRetail` - LightspeedRetail
+ * * `ShipStation` - ShipStation
+ * * `ConstantContact` - ConstantContact
+ * * `Mailgun` - Mailgun
+ * * `Eloqua` - Eloqua
+ * * `Sailthru` - Sailthru
+ * * `Ortto` - Ortto
+ * * `Attentive` - Attentive
+ * * `Kustomer` - Kustomer
+ * * `Dixa` - Dixa
+ * * `Gladly` - Gladly
+ * * `Qualtrics` - Qualtrics
+ * * `Delighted` - Delighted
+ * * `AzureDevOps` - AzureDevOps
+ * * `Rollbar` - Rollbar
+ * * `Opsgenie` - Opsgenie
+ * * `IncidentIo` - IncidentIo
+ * * `Pingdom` - Pingdom
+ * * `Cloudflare` - Cloudflare
+ * * `CosmosDB` - CosmosDB
+ * * `PlanetScale` - PlanetScale
+ * * `SapHana` - SapHana
+ * * `Rippling` - Rippling
+ * * `HiBob` - HiBob
+ * * `Personio` - Personio
+ * * `Deel` - Deel
+ * * `AdpWorkforceNow` - AdpWorkforceNow
+ * * `Paylocity` - Paylocity
+ * * `Gusto` - Gusto
+ * * `CultureAmp` - CultureAmp
+ * * `Lattice` - Lattice
+ * * `SageIntacct` - SageIntacct
+ * * `FreshBooks` - FreshBooks
+ * * `Expensify` - Expensify
+ * * `Ramp` - Ramp
+ * * `Brex` - Brex
+ * * `Coupa` - Coupa
+ * * `SapConcur` - SapConcur
+ * * `Apollo` - Apollo
+ * * `Crunchbase` - Crunchbase
+ * * `ZoomInfo` - ZoomInfo
+ * * `Clari` - Clari
+ * * `Chorus` - Chorus
+ * * `Coda` - Coda
+ * * `Guru` - Guru
+ * * `Dropbox` - Dropbox
+ * * `Docusign` - Docusign
+ * * `PandaDoc` - PandaDoc
+ * * `SapErp` - SapErp
+ * * `SapSuccessFactors` - SapSuccessFactors
+ * * `OracleEbs` - OracleEbs
+ * * `OracleFusion` - OracleFusion
+ * * `AmazonSNS` - AmazonSNS
+ * * `AmazonEventBridge` - AmazonEventBridge
+ * * `AmazonSQS` - AmazonSQS
+ * * `AmazonKinesis` - AmazonKinesis
+ * * `AmazonCloudWatch` - AmazonCloudWatch
+ * * `OpenAIAds` - OpenAIAds
+ * * `OneHundredMs` - OneHundredMs
+ * * `SevenShifts` - SevenShifts
+ * * `AcuityScheduling` - AcuityScheduling
+ * * `AgileCRM` - AgileCRM
+ * * `Aha` - Aha
+ * * `Airbyte` - Airbyte
+ * * `Akeneo` - Akeneo
+ * * `Algolia` - Algolia
+ * * `AlpacaBrokerAPI` - AlpacaBrokerAPI
+ * * `ApifyDataset` - ApifyDataset
+ * * `Appcues` - Appcues
+ * * `Appfigures` - Appfigures
+ * * `Appfollow` - Appfollow
+ * * `Apptivo` - Apptivo
+ * * `AssemblyAI` - AssemblyAI
+ * * `Awin` - Awin
+ * * `AwsCloudTrail` - AwsCloudTrail
+ * * `AzureTableStorage` - AzureTableStorage
+ * * `Babelforce` - Babelforce
+ * * `Basecamp` - Basecamp
+ * * `Beamer` - Beamer
+ * * `BigMailer` - BigMailer
+ * * `Bluetally` - Bluetally
+ * * `BoldSign` - BoldSign
+ * * `BreezyHR` - BreezyHR
+ * * `Bugsnag` - Bugsnag
+ * * `Buildkite` - Buildkite
+ * * `Bunny` - Bunny
+ * * `Buzzsprout` - Buzzsprout
+ * * `CalCom` - CalCom
+ * * `CallRail` - CallRail
+ * * `Campayn` - Campayn
+ * * `Canny` - Canny
+ * * `CapsuleCRM` - CapsuleCRM
+ * * `CaptainData` - CaptainData
+ * * `CartCom` - CartCom
+ * * `CastorEDC` - CastorEDC
+ * * `Chameleon` - Chameleon
+ * * `Chargedesk` - Chargedesk
+ * * `Chargify` - Chargify
+ * * `Chift` - Chift
+ * * `Churnkey` - Churnkey
+ * * `Cin7` - Cin7
+ * * `CiscoMeraki` - CiscoMeraki
+ * * `Clazar` - Clazar
+ * * `Clockify` - Clockify
+ * * `Clockodo` - Clockodo
+ * * `Cloudbeds` - Cloudbeds
+ * * `Coassemble` - Coassemble
+ * * `Codefresh` - Codefresh
+ * * `Concord` - Concord
+ * * `ConfigCat` - ConfigCat
+ * * `Couchbase` - Couchbase
+ * * `Curve` - Curve
+ * * `Customerly` - Customerly
+ * * `Datascope` - Datascope
+ * * `Dbt` - Dbt
+ * * `Deputy` - Deputy
+ * * `DevinAI` - DevinAI
+ * * `Docuseal` - Docuseal
+ * * `Dolibarr` - Dolibarr
+ * * `Dremio` - Dremio
+ * * `DropboxSign` - DropboxSign
+ * * `Dwolla` - Dwolla
+ * * `EConomic` - EConomic
+ * * `Easypost` - Easypost
+ * * `Easypromos` - Easypromos
+ * * `Elasticemail` - Elasticemail
+ * * `EmailOctopus` - EmailOctopus
+ * * `EmploymentHero` - EmploymentHero
+ * * `Encharge` - Encharge
+ * * `Eventee` - Eventee
+ * * `Eventzilla` - Eventzilla
+ * * `Everhour` - Everhour
+ * * `EZOfficeInventory` - EZOfficeInventory
+ * * `Factorial` - Factorial
+ * * `Fastbill` - Fastbill
+ * * `Fastly` - Fastly
+ * * `Fauna` - Fauna
+ * * `Feishu` - Feishu
+ * * `Fillout` - Fillout
+ * * `Finage` - Finage
+ * * `Firebolt` - Firebolt
+ * * `FireHydrant` - FireHydrant
+ * * `Fleetio` - Fleetio
+ * * `Flexmail` - Flexmail
+ * * `Flexport` - Flexport
+ * * `FloatApp` - FloatApp
+ * * `Flowlu` - Flowlu
+ * * `Formbricks` - Formbricks
+ * * `FreeAgent` - FreeAgent
+ * * `Freightview` - Freightview
+ * * `Freshcaller` - Freshcaller
+ * * `Freshchat` - Freshchat
+ * * `Freshservice` - Freshservice
+ * * `Fulcrum` - Fulcrum
+ * * `GainsightPx` - GainsightPx
+ * * `GitBook` - GitBook
+ * * `Glassfrog` - Glassfrog
+ * * `Goldcast` - Goldcast
+ * * `GoLogin` - GoLogin
+ * * `Grafana` - Grafana
+ * * `GreytHr` - GreytHr
+ * * `Gridly` - Gridly
+ * * `Harness` - Harness
+ * * `Height` - Height
+ * * `Hellobaton` - Hellobaton
+ * * `HighLevel` - HighLevel
+ * * `HoorayHR` - HoorayHR
+ * * `Hubplanner` - Hubplanner
+ * * `Humanitix` - Humanitix
+ * * `Huntr` - Huntr
+ * * `Inflowinventory` - Inflowinventory
+ * * `InforNexus` - InforNexus
+ * * `Insightful` - Insightful
+ * * `Insightly` - Insightly
+ * * `Instantly` - Instantly
+ * * `Instatus` - Instatus
+ * * `Intruder` - Intruder
+ * * `Invoiced` - Invoiced
+ * * `Invoiceninja` - Invoiceninja
+ * * `JamfPro` - JamfPro
+ * * `JobNimbus` - JobNimbus
+ * * `Jotform` - Jotform
+ * * `JudgeMeReviews` - JudgeMeReviews
+ * * `JustCall` - JustCall
+ * * `JustSift` - JustSift
+ * * `K6Cloud` - K6Cloud
+ * * `Katana` - Katana
+ * * `Keka` - Keka
+ * * `Kisi` - Kisi
+ * * `Kissmetrics` - Kissmetrics
+ * * `Klarna` - Klarna
+ * * `Klaus` - Klaus
+ * * `Lago` - Lago
+ * * `Leadfeeder` - Leadfeeder
+ * * `Lemlist` - Lemlist
+ * * `LessAnnoyingCRM` - LessAnnoyingCRM
+ * * `LinkedinPages` - LinkedinPages
+ * * `Linkrunner` - Linkrunner
+ * * `Linnworks` - Linnworks
+ * * `Lob` - Lob
+ * * `Lokalise` - Lokalise
+ * * `Looker` - Looker
+ * * `Luma` - Luma
+ * * `MailerSend` - MailerSend
+ * * `Mailosaur` - Mailosaur
+ * * `Mailtrap` - Mailtrap
+ * * `Mantle` - Mantle
+ * * `Mention` - Mention
+ * * `MercadoAds` - MercadoAds
+ * * `Merge` - Merge
+ * * `Metabase` - Metabase
+ * * `Metricool` - Metricool
+ * * `MicrosoftDataverse` - MicrosoftDataverse
+ * * `MicrosoftEntraId` - MicrosoftEntraId
+ * * `MicrosoftLists` - MicrosoftLists
+ * * `Miro` - Miro
+ * * `Missive` - Missive
+ * * `MixMax` - MixMax
+ * * `Mode` - Mode
+ * * `Mux` - Mux
+ * * `MyHours` - MyHours
+ * * `N8n` - N8n
+ * * `Navan` - Navan
+ * * `NebiusAI` - NebiusAI
+ * * `Nexiopay` - Nexiopay
+ * * `NinjaOneRMM` - NinjaOneRMM
+ * * `NoCRM` - NoCRM
+ * * `NorthpassLMS` - NorthpassLMS
+ * * `Nutshell` - Nutshell
+ * * `Nylas` - Nylas
+ * * `Oncehub` - Oncehub
+ * * `Onepagecrm` - Onepagecrm
+ * * `OneSignal` - OneSignal
+ * * `Onfleet` - Onfleet
+ * * `OpinionStage` - OpinionStage
+ * * `OPUSWatch` - OPUSWatch
+ * * `Orb` - Orb
+ * * `Orbit` - Orbit
+ * * `Oura` - Oura
+ * * `Oveit` - Oveit
+ * * `PabblySubscriptionsBilling` - PabblySubscriptionsBilling
+ * * `Paperform` - Paperform
+ * * `Papersign` - Papersign
+ * * `Partnerize` - Partnerize
+ * * `PartnerStack` - PartnerStack
+ * * `PayFit` - PayFit
+ * * `Paystack` - Paystack
+ * * `Pennylane` - Pennylane
+ * * `Perk` - Perk
+ * * `PersistIq` - PersistIq
+ * * `Persona` - Persona
+ * * `Phyllo` - Phyllo
+ * * `Picqer` - Picqer
+ * * `Pipeliner` - Pipeliner
+ * * `PivotalTracker` - PivotalTracker
+ * * `Piwik` - Piwik
+ * * `Planhat` - Planhat
+ * * `Plausible` - Plausible
+ * * `Poplar` - Poplar
+ * * `PrestaShop` - PrestaShop
+ * * `Pretix` - Pretix
+ * * `Primetric` - Primetric
+ * * `Printify` - Printify
+ * * `Productive` - Productive
+ * * `Pylon` - Pylon
+ * * `Qonto` - Qonto
+ * * `Qualaroo` - Qualaroo
+ * * `Railz` - Railz
+ * * `RDStationMarketing` - RDStationMarketing
+ * * `Recruitee` - Recruitee
+ * * `Reddit` - Reddit
+ * * `ReferralHero` - ReferralHero
+ * * `RentCast` - RentCast
+ * * `Repairshopr` - Repairshopr
+ * * `ReplyIo` - ReplyIo
+ * * `RetailExpress` - RetailExpress
+ * * `Retently` - Retently
+ * * `RevolutMerchant` - RevolutMerchant
+ * * `RocketChat` - RocketChat
+ * * `Rocketlane` - Rocketlane
+ * * `Rootly` - Rootly
+ * * `Ruddr` - Ruddr
+ * * `SafetyCulture` - SafetyCulture
+ * * `SageHR` - SageHR
+ * * `Salesflare` - Salesflare
+ * * `SAPFieldglass` - SAPFieldglass
+ * * `SavvyCal` - SavvyCal
+ * * `Secoda` - Secoda
+ * * `Segment` - Segment
+ * * `Sendowl` - Sendowl
+ * * `SendPulse` - SendPulse
+ * * `Senseforce` - Senseforce
+ * * `Serpstat` - Serpstat
+ * * `Sharetribe` - Sharetribe
+ * * `Shippo` - Shippo
+ * * `ShopWired` - ShopWired
+ * * `Shortio` - Shortio
+ * * `Shutterstock` - Shutterstock
+ * * `SigmaComputing` - SigmaComputing
+ * * `SignNow` - SignNow
+ * * `SimpleCast` - SimpleCast
+ * * `Simplesat` - Simplesat
+ * * `Smaily` - Smaily
+ * * `SmartEngage` - SmartEngage
+ * * `Smartreach` - Smartreach
+ * * `Smartwaiver` - Smartwaiver
+ * * `SolarwindsServiceDesk` - SolarwindsServiceDesk
+ * * `SonarCloud` - SonarCloud
+ * * `SparkPost` - SparkPost
+ * * `SplitIo` - SplitIo
+ * * `SpotifyAds` - SpotifyAds
+ * * `SpotlerCRM` - SpotlerCRM
+ * * `Squarespace` - Squarespace
+ * * `Statsig` - Statsig
+ * * `Statuspage` - Statuspage
+ * * `Stigg` - Stigg
+ * * `Strava` - Strava
+ * * `SurveySparrow` - SurveySparrow
+ * * `Survicate` - Survicate
+ * * `Svix` - Svix
+ * * `Systeme` - Systeme
+ * * `Tavus` - Tavus
+ * * `Teamtailor` - Teamtailor
+ * * `Teamwork` - Teamwork
+ * * `Tempo` - Tempo
+ * * `Testrail` - Testrail
+ * * `Thinkific` - Thinkific
+ * * `ThinkificCourses` - ThinkificCourses
+ * * `ThriveLearning` - ThriveLearning
+ * * `Ticketmaster` - Ticketmaster
+ * * `TicketTailor` - TicketTailor
+ * * `TickTick` - TickTick
+ * * `Timely` - Timely
+ * * `Tinyemail` - Tinyemail
+ * * `Todoist` - Todoist
+ * * `Toggl` - Toggl
+ * * `TrackPMS` - TrackPMS
+ * * `Tremendous` - Tremendous
+ * * `TrustPilot` - TrustPilot
+ * * `Twitter` - Twitter
+ * * `TyntecSMS` - TyntecSMS
+ * * `Unleash` - Unleash
+ * * `UpPromote` - UpPromote
+ * * `Uptick` - Uptick
+ * * `Uservoice` - Uservoice
+ * * `Vantage` - Vantage
+ * * `Veeqo` - Veeqo
+ * * `Vercel` - Vercel
+ * * `VismaEconomic` - VismaEconomic
+ * * `VWO` - VWO
+ * * `Waiteraid` - Waiteraid
+ * * `Wasabi` - Wasabi
+ * * `WhenIWork` - WhenIWork
+ * * `Wordpress` - Wordpress
+ * * `Workable` - Workable
+ * * `Workflowmax` - Workflowmax
+ * * `Workramp` - Workramp
+ * * `Wufoo` - Wufoo
+ * * `Xsolla` - Xsolla
+ * * `YandexMetrica` - YandexMetrica
+ * * `Yotpo` - Yotpo
+ * * `Ynab` - Ynab
+ * * `Younium` - Younium
+ * * `YouSign` - YouSign
+ * * `YoutubeData` - YoutubeData
+ * * `ZapierSupportedStorage` - ZapierSupportedStorage
+ * * `ZapSign` - ZapSign
+ * * `ZendeskSell` - ZendeskSell
+ * * `ZendeskSunshine` - ZendeskSunshine
+ * * `Zenefits` - Zenefits
+ * * `Zenloop` - Zenloop
+ * * `ZohoAnalytics` - ZohoAnalytics
+ * * `ZohoBigin` - ZohoBigin
+ * * `ZohoBilling` - ZohoBilling
+ * * `ZohoBooks` - ZohoBooks
+ * * `ZohoCampaign` - ZohoCampaign
+ * * `ZohoDesk` - ZohoDesk
+ * * `ZohoExpense` - ZohoExpense
+ * * `ZohoInventory` - ZohoInventory
+ * * `ZohoInvoice` - ZohoInvoice
+ * * `ZonkaFeedback` - ZonkaFeedback
+ * * `AlphaVantage` - AlphaVantage
+ * * `Aviationstack` - Aviationstack
+ * * `Bitly` - Bitly
+ * * `Blogger` - Blogger
+ * * `Breezometer` - Breezometer
+ * * `CareQualityCommission` - CareQualityCommission
+ * * `Cimis` - Cimis
+ * * `CoinApi` - CoinApi
+ * * `CoinGecko` - CoinGecko
+ * * `CoinMarketCap` - CoinMarketCap
+ * * `DingConnect` - DingConnect
+ * * `Dockerhub` - Dockerhub
+ * * `ExchangeRatesApi` - ExchangeRatesApi
+ * * `FinancialModelling` - FinancialModelling
+ * * `Finnhub` - Finnhub
+ * * `Finnworlds` - Finnworlds
+ * * `Giphy` - Giphy
+ * * `Gmail` - Gmail
+ * * `GNews` - GNews
+ * * `GoogleCalendar` - GoogleCalendar
+ * * `GoogleClassroom` - GoogleClassroom
+ * * `GoogleDirectory` - GoogleDirectory
+ * * `GoogleForms` - GoogleForms
+ * * `GooglePageSpeedInsights` - GooglePageSpeedInsights
+ * * `GoogleTasks` - GoogleTasks
+ * * `GoogleWebfonts` - GoogleWebfonts
+ * * `GoogleWorkspaceAdminReports` - GoogleWorkspaceAdminReports
+ * * `HuggingFace` - HuggingFace
+ * * `IlluminaBasespace` - IlluminaBasespace
+ * * `Imagga` - Imagga
+ * * `Interzoid` - Interzoid
+ * * `IP2Whois` - IP2Whois
+ * * `KYVE` - KYVE
+ * * `Marketstack` - Marketstack
+ * * `Mendeley` - Mendeley
+ * * `Nasa` - Nasa
+ * * `NewYorkTimes` - NewYorkTimes
+ * * `NewsApi` - NewsApi
+ * * `NewsData` - NewsData
+ * * `OpenDataDc` - OpenDataDc
+ * * `OpenExchangeRates` - OpenExchangeRates
+ * * `OpenAQ` - OpenAQ
+ * * `OpenFDA` - OpenFDA
+ * * `OpenWeather` - OpenWeather
+ * * `Outlook` - Outlook
+ * * `Perigon` - Perigon
+ * * `Pexels` - Pexels
+ * * `Pocket` - Pocket
+ * * `Polygon` - Polygon
+ * * `PyPI` - PyPI
+ * * `Recreation` - Recreation
+ * * `RKICovid` - RKICovid
+ * * `Rss` - Rss
+ * * `SimFin` - SimFin
+ * * `StockData` - StockData
+ * * `Guardian` - Guardian
+ * * `TMDb` - TMDb
+ * * `TVMaze` - TVMaze
+ * * `TwelveData` - TwelveData
+ * * `Ubidots` - Ubidots
+ * * `USCensus` - USCensus
+ * * `Watchmode` - Watchmode
+ * * `WikipediaPageviews` - WikipediaPageviews
+ * * `YahooFinance` - YahooFinance
+ * * `Clarifai` - Clarifai
+ * * `Adapty` - Adapty
+ * * `Braintrust` - Braintrust
+ * * `StreamElements` - StreamElements
+ * * `Streamlabs` - Streamlabs
+ * * `Datorama` - Datorama
+ * * `Ahrefs` - Ahrefs
+ * * `Lightfield` - Lightfield
+ * * `Appstack` - Appstack
+ * * `Razorpay` - Razorpay
+ * * `Neon` - Neon
+ * * `NewRelic` - NewRelic
+ * * `Custom` - Custom
+ * * `Tile38` - Tile38
+ * * `Chatwoot` - Chatwoot
+ * * `Sanity` - Sanity
+ * * `Metronome` - Metronome
+ * * `Jobber` - Jobber
+ * * `Knock` - Knock
+ * * `Leexi` - Leexi
+ * * `RB2B` - RB2B
+ * * `Superwall` - Superwall
+ * * `Liana` - Liana
+ * * `TawkTo` - TawkTo
+ * * `Hightouch` - Hightouch
+ * * `LemonSqueezy` - LemonSqueezy
+ * * `Ikas` - Ikas
+ * * `Talkwalker` - Talkwalker
+ * * `NextdoorAds` - NextdoorAds
+ * * `AppLovin` - AppLovin
+ * * `Baserow` - Baserow
+ * * `Plunk` - Plunk
+ * * `Dub` - Dub
+ * * `AirOps` - AirOps
+ * * `Podium` - Podium
+ * * `Loops` - Loops
+ * * `Redis` - Redis
+ * * `Mercury` - Mercury
+ * * `Gojiberry` - Gojiberry
+ * * `Teachable` - Teachable
+ * * `PeecAI` - PeecAI
+ * * `Healthchecks` - Healthchecks
+ * * `Impact` - Impact
+ * * `AikidoSecurity` - AikidoSecurity
+ * * `Alguna` - Alguna
+ * * `Anthropic` - Anthropic
+ * * `Appwrite` - Appwrite
+ * * `BlandAI` - BlandAI
+ * * `BrowseAI` - BrowseAI
+ * * `BrowserUse` - BrowserUse
+ * * `ChartHop` - ChartHop
+ * * `Cody` - Cody
+ * * `Cursor` - Cursor
+ * * `Decagon` - Decagon
+ * * `Deepgram` - Deepgram
+ * * `ElevenLabs` - ElevenLabs
+ * * `Harvey` - Harvey
+ * * `Hyperspell` - Hyperspell
+ * * `Langfuse` - Langfuse
+ * * `LingoDev` - LingoDev
+ * * `M3ter` - M3ter
+ * * `Maxio` - Maxio
+ * * `Metorial` - Metorial
+ * * `OpenRouter` - OpenRouter
+ * * `TogetherAI` - TogetherAI
+ * * `Vapi` - Vapi
+ * * `Vespa` - Vespa
+ * * `Writesonic` - Writesonic
+ * * `Aiven` - Aiven
+ * * `Aviator` - Aviator
+ * * `Backblaze` - Backblaze
+ * * `Baseten` - Baseten
+ * * `Browserbase` - Browserbase
+ * * `Cohere` - Cohere
+ * * `DenoDeploy` - DenoDeploy
+ * * `DigitalOcean` - DigitalOcean
+ * * `E2B` - E2B
+ * * `Fintoc` - Fintoc
+ * * `Firecrawl` - Firecrawl
+ * * `FireworksAI` - FireworksAI
+ * * `FlyIo` - FlyIo
+ * * `Groq` - Groq
+ * * `GrowthBook` - GrowthBook
+ * * `Gumloop` - Gumloop
+ * * `Hatchet` - Hatchet
+ * * `Helicone` - Helicone
+ * * `Heroku` - Heroku
+ * * `Hetzner` - Hetzner
+ * * `HeyGen` - HeyGen
+ * * `Infisical` - Infisical
+ * * `Inngest` - Inngest
+ * * `KapaAI` - KapaAI
+ * * `Kernel` - Kernel
+ * * `Koyeb` - Koyeb
+ * * `LambdaLabs` - LambdaLabs
+ * * `LangSmith` - LangSmith
+ * * `Linode` - Linode
+ * * `LlamaCloud` - LlamaCloud
+ * * `Mem0` - Mem0
+ * * `Metriport` - Metriport
+ * * `Mintlify` - Mintlify
+ * * `MistralAI` - MistralAI
+ * * `Mono` - Mono
+ * * `Netlify` - Netlify
+ * * `Northflank` - Northflank
+ * * `OpenAI` - OpenAI
+ * * `Pinecone` - Pinecone
+ * * `PlatformSh` - PlatformSh
+ * * `PromptingCompany` - PromptingCompany
+ * * `Qdrant` - Qdrant
+ * * `Render` - Render
+ * * `Replicate` - Replicate
+ * * `RetellAI` - RetellAI
+ * * `Roark` - Roark
+ * * `RunPod` - RunPod
+ * * `ScaleAI` - ScaleAI
+ * * `Scaleway` - Scaleway
+ * * `SigNoz` - SigNoz
+ * * `Sim` - Sim
+ * * `Skyvern` - Skyvern
+ * * `Slash` - Slash
+ * * `Synthesia` - Synthesia
+ * * `Telli` - Telli
+ * * `TerraApi` - TerraApi
+ * * `TriggerDev` - TriggerDev
+ * * `Turso` - Turso
+ * * `Singular` - Singular
+ * * `Swonkie` - Swonkie
+ * * `TwelveLabs` - TwelveLabs
+ * * `Twenty` - Twenty
+ * * `Unstructured` - Unstructured
+ * * `Upstash` - Upstash
+ * * `Vellum` - Vellum
+ * * `Vultr` - Vultr
+ * * `Windmill` - Windmill
+ * * `Zep` - Zep
+ * * `Hex` - Hex
+ * * `Sumsub` - Sumsub
+ * * `GoogleChat` - GoogleChat
+ * * `Kickscale` - Kickscale
+ * * `Zellify` - Zellify
+ * * `RudderStack` - RudderStack */
+ readonly source_type: ExternalDataSourceTypeEnum;
+ /** 'direct' for pure live-query sources; 'warehouse' for synced sources with direct query enabled.
+ *
+ * * `warehouse` - warehouse
+ * * `direct` - direct */
+ readonly access_method: AccessMethodEnum;
+ /** Whether HogQL queries compile for this connection. When false, only raw SQL (sendRawQuery) works. */
+ readonly supports_hogql: boolean;
}
/**
@@ -25127,7 +25900,7 @@ export namespace Schemas {
* * `api` - api
* * `mcp` - mcp */
created_via?: ExternalDataSourceCreateCreatedViaEnum;
- /** Whether a synced source should also be live-queryable via direct connection. Defaults to true; ignored for pure direct-query sources. */
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources. */
direct_query_enabled?: boolean;
}
@@ -25213,7 +25986,7 @@ 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. */
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean;
/** Backend engine detected for the direct connection.
*
@@ -29274,7 +30047,7 @@ export namespace Schemas {
export type HogQLMetadataVariables = {[key: string]: HogQLVariable} | null;
export interface HogQLMetadata {
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string | null;
/** Enable more verbose output, usually run from the /debug page */
debug?: boolean | null;
@@ -29300,7 +30073,7 @@ export namespace Schemas {
}
export interface HogQLAutocomplete {
- /** Optional id of a direct external data source (access_method='direct') to run against instead of ClickHouse. Warehouse import sources are not valid here. */
+ /** Optional id of a direct-query-capable external data source to run against instead of ClickHouse — a pure-direct source, or a synced source with direct query enabled. */
connectionId?: string | null;
/** End position of the editor word */
endPosition: number;
@@ -40770,7 +41543,7 @@ 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. */
+ /** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean;
/** Backend engine detected for the direct connection.
*
@@ -54994,7 +55767,7 @@ 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. */
+ /** Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources. */
direct_query_enabled?: boolean;
}
diff --git a/services/mcp/src/generated/warehouse_sources/api.ts b/services/mcp/src/generated/warehouse_sources/api.ts
index bcdb0bdbfbdc..9b39e6c12236 100644
--- a/services/mcp/src/generated/warehouse_sources/api.ts
+++ b/services/mcp/src/generated/warehouse_sources/api.ts
@@ -628,7 +628,7 @@ export const externalDataSourcesCreateBodyPrefixMax = 100
export const externalDataSourcesCreateBodyDescriptionMax = 400
export const externalDataSourcesCreateBodyAccessMethodDefault = `warehouse`
-export const externalDataSourcesCreateBodyDirectQueryEnabledDefault = true
+export const externalDataSourcesCreateBodyDirectQueryEnabledDefault = false
export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
@@ -1421,7 +1421,7 @@ export const ExternalDataSourcesCreateBody = /* @__PURE__ */ zod.object({
.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.'
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources.'
),
})
@@ -1474,7 +1474,7 @@ export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1529,7 +1529,7 @@ export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1572,7 +1572,7 @@ export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1607,7 +1607,7 @@ export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1641,7 +1641,7 @@ export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ 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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
})
.describe('Mixin for serializers to add user access control fields')
@@ -1704,7 +1704,7 @@ export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */
.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.'
+ 'Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.'
),
job_inputs: zod.unknown().optional(),
})
@@ -1798,7 +1798,7 @@ export const externalDataSourcesSetupCreateBodyPrefixMax = 100
export const externalDataSourcesSetupCreateBodyDescriptionMax = 400
-export const externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault = true
+export const externalDataSourcesSetupCreateBodyDirectQueryEnabledDefault = false
export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
source_type: zod
@@ -2591,7 +2591,7 @@ export const ExternalDataSourcesSetupCreateBody = /* @__PURE__ */ zod.object({
.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.'
+ 'Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources.'
),
})
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 be5d441bc7b1..50ba55b63f53 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
@@ -14,8 +14,8 @@
"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.",
+ "default": false,
+ "description": "Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources.",
"type": "boolean"
},
"payload": {
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 acc4ee22d2dd..57710e6da0b8 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
@@ -32,7 +32,7 @@
]
},
"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.",
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",
"type": "boolean"
},
"id": {
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 63ad18fda34d..711b1ea94a4d 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
@@ -20,8 +20,8 @@
"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.",
+ "default": false,
+ "description": "Whether a synced source should also be live-queryable via direct connection. Defaults to false; ignored for pure direct-query sources.",
"type": "boolean"
},
"payload": {
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 acc4ee22d2dd..57710e6da0b8 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
@@ -32,7 +32,7 @@
]
},
"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.",
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",
"type": "boolean"
},
"id": {
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 efd983121b22..f401dbaed7a1 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
@@ -32,7 +32,7 @@
]
},
"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.",
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",
"type": "boolean"
},
"id": {
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 1bb2eaaf8788..be1715e7deac 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
@@ -15,7 +15,7 @@
"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, `wizard` for the setup wizard (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"
},
"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.",
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",
"type": "boolean"
},
"id": {
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 1bb2eaaf8788..be1715e7deac 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
@@ -15,7 +15,7 @@
"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, `wizard` for the setup wizard (derived server-side from the wizard's user agent). Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp\n* `wizard` - wizard"
},
"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.",
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",
"type": "boolean"
},
"id": {
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 acc4ee22d2dd..57710e6da0b8 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
@@ -32,7 +32,7 @@
]
},
"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.",
+ "description": "Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources.",
"type": "boolean"
},
"id": {