i am trying to use mysql as source and by default ...
# ask-ai
g
i am trying to use mysql as source and by default use all streams, but does not seem to work, i use this json, can you adjust?: "mysql": { "workspaceId": "id", "configuration": { "sourceType": "mysql", "host": "host", "port": 3306, "database": "database", "username": "root", "password": "password", "replication_method": { "method": "CDC" }, "schemas": ["*"] }, "name": "mysql" },
k
Based on the available knowledge sources, Airbyte does not support using a wildcard like
"schemas": ["*"]
to automatically select all schemas or streams in a MySQL source configuration. The Airbyte MySQL source connector typically discovers all tables (streams) within the specified database, and you can select which streams to sync via the Airbyte UI under the "Schema" tab. There is no documented support for a
"schemas"
field in the MySQL source configuration JSON, nor for using wildcards to select all schemas or tables by default. If your goal is to sync all tables from a single schema (database), you should omit the
"schemas"
field entirely. Airbyte will then discover all tables in the specified
"database"
and you can enable all streams (tables) in the UI or via the API. If you want to automate this, you may need to programmatically enable all discovered streams after the source is set up, but this is not done via the source configuration JSON itself. Here is an adjusted example of the configuration JSON (note the removal of the
"schemas"
field):
Copy code
json {   "mysql": {     "workspaceId": "id",     "configuration": {       "sourceType": "mysql",       "host": "host",       "port": 3306,       "database": "database",       "username": "root",       "password": "password",       "replication_method": { "method": "CDC" }     },     "name": "mysql"   } }
After setting up the source, use the Airbyte UI or API to select all streams for syncing. If you have multiple schemas in your MySQL instance and want to sync from all of them, Airbyte currently requires you to create separate source connections for each schema/database, as there is no built-in support for multi-schema selection in a single connection. This limitation is also discussed in [this GitHub issue](https://github.com/airbytehq/airbyte/issues/18042). Summary: - Remove the
"schemas"
field from your configuration. - Airbyte will discover all tables in the specified database. - Select all streams in the UI or via API after source setup. - Multi-schema support in a single connection is not available at this time. If you need to automate stream selection, you may need to use Airbyte's API to programmatically enable all streams after discovery, but this is not handled in the source configuration JSON itself. References: - [Configuring Schemas](https://docs.airbyte.com/platform/using-airbyte/configuring-schema) - [GitHub Issue: Source MySQL: different schemas with same prefix and same tables](https://github.com/airbytehq/airbyte/issues/18042)
g
How can I automatically select/fetch all streams when a connection is created and/or when its schema is refreshed? @kapa.ai
k
A message from kapa.ai
Airbyte does not currently support automatically selecting or fetching all streams (tables) by default when a connection is created or when its schema is refreshed. When you create a connection, Airbyte will discover all available streams in the specified database, but you must manually select which streams to sync in the Airbyte UI under the "Schema" tab. There is no configuration option or API parameter documented that enables automatic selection of all streams upon creation or schema refresh. If you want to enable all streams, you need to manually toggle them on in the UI, or use the Airbyte API to programmatically enable them after discovery. This limitation is confirmed in the documentation and community discussions, where users have requested such a feature, but as of now, it is not available natively in Airbyte. The team has acknowledged this as a feature request and is tracking it for future development, but it is not yet implemented [source](https://discuss.airbyte.io/t/2315). Summary: - Airbyte discovers all streams, but you must manually select them. - There is no built-in way to auto-select all streams on connection creation or schema refresh. - Feature requests for this capability are open, but not yet implemented. If you need this functionality, you may need to build automation around the Airbyte API to enable all streams after schema discovery, but this is not handled automatically by Airbyte itself at this time.
g
how can i query the source schema using the api? @kapa.ai
k
A message from kapa.ai
To query the source schema using the Airbyte API, you can use the
GET /streams
endpoint. This endpoint allows you to fetch the available stream properties (schema) for a given source and destination pair. You need to provide the
sourceId
and
destinationId
as query parameters. Optionally, you can set
ignoreCache=true
to force a fresh schema discovery from the source. Example request:
Copy code
GET /streams?sourceId=<SOURCE_ID>&destinationId=<DESTINATION_ID>&ignoreCache=true
This will return a list of streams (tables) and their properties, including sync modes, cursor fields, primary keys, and field definitions. This is the recommended way to programmatically fetch the source schema via the Airbyte Public API [see API reference](https://reference.airbyte.com/reference/getstreamproperties). Note: - For Airbyte OSS users, the API path prefix is
/api/public/v1
(e.g., `http://localhost:8000/api/public/v1/streams`) [API documentation](https://docs.airbyte.com/platform/next/api-documentation). - Authentication and additional headers may be required depending on your Airbyte deployment. Summary: Use the
GET /streams
endpoint with the appropriate parameters to query the source schema programmatically via the Airbyte API [API YAML](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml).
g
@kapa.ai can you give me a response example of a get streams request?
k
A message from kapa.ai
I'm sorry, but the knowledge sources provided do not contain a concrete example of a response payload for the
GET /streams
API request. The documentation describes the endpoint, its parameters, and the general structure of the response (such as including stream names, sync modes, cursor fields, and property fields), but does not provide a full sample response body with actual data fields and values [see API YAML](https://raw.githubusercontent.com/airbytehq/airbyte-platform/f284238f0099c4c0a3542d4c42a88773c45c363d/airbyte-api/src/main/openapi/api.yaml). If you need a specific example, you may need to run the API call against your Airbyte instance to see the actual response format.