Airbyte connectors generally do not support executing arbitrary queries directly as part of the sync process. Airbyte follows the ELT paradigm, focusing on extracting and loading raw data from sources to destinations, and then transforming it afterward. This means: -
Arbitrary Query Execution: Airbyte source connectors do not provide a built-in way to execute arbitrary SQL or API queries as part of the sync configuration. If you want to filter or aggregate data before syncing, the recommended approach is to create a view or a custom endpoint on your source system and then configure Airbyte to sync from that view or endpoint. This is confirmed in several community discussions and official responses, which clarify that Airbyte does not allow users to build predicates or custom queries for filtering source data directly in the connector configuration. Instead, you should prepare the data you want to sync on the source side (e.g., via a database view) and then point Airbyte to that view for extraction [Airbyte lookup values](
https://discuss.airbyte.io/t/991), [dbt transformation to aggregate data](
https://discuss.airbyte.io/t/3455). -
Custom Query Support in Some Connectors: Some connectors, like Google Ads and Google Search Console, do support custom queries or custom reports as part of their configuration. For example, the Google Ads connector allows you to define custom GAQL queries, and the Google Search Console connector lets you define custom reports with specific dimensions. However, this is connector-specific and not a general feature across all connectors [Google Ads custom query](
https://docs.airbyte.com/integrations/sources/google-ads#custom-query-understanding-google-ads-query-language), [Google Search Console custom reports](
https://docs.airbyte.com/integrations/sources/google-search-console#custom-reports). -
Storing Record Count for Each Stream: Airbyte does not natively store or expose the record count for each stream as part of the sync process. However, in your destination, each record includes an
airbyte_emitted_at
column, which you can use to count the number of records loaded per stream and per time period (e.g., monthly active rows) by running a query on your destination database [Monthly Active Rows](
https://discuss.airbyte.io/t/968).
Summary: - You cannot execute arbitrary queries via most Airbyte connectors. - Some connectors (like Google Ads) allow custom queries as part of their configuration. - To filter or aggregate data before syncing, use a view or custom endpoint on your source. - To get record counts, query your destination using the
airbyte_emitted_at
field. If you have a specific connector in mind, let me know, as some connectors have unique capabilities.