Comment on page
Data sources refer to the different types of data environments available throughout a Xano workspace. For example, the Scale plan supports two environments for data sources: live (production) and test. Your live data source is the data that is live for your application. Test data source allows you to create test data with the same schema set up so that you can run tests without affecting your users' data.
You can easily see which data source is active from the notifier in the left-hand panel. You can also click this to add new and switch to additional data sources.
Once you select the data source identifier button and click Manage Data Sources, you can click '+ Add Test Data Source' and be taken to the data source manager panel where you can add a new test environment. Each data source is represented by a color of your choosing.
It's important to note that a test data source will have exactly the same data schema and structure as your live environment. You cannot change, edit, or delete the schema or database tables in your test data source environment. The test environment allows you to use different data or records so that you can perform tests in your API without affecting your live data.
A test data source does not copy your live data. It has only the same schema so that you can add test or dummy data.
You are able to delete your test data source to easily start over. However, you cannot delete your live data source or change which data source is live and test.
When in a test data source environment, Xano will notify you throughout your workspace with a banner at the top of the page. You can easily switch back to live data at any time by select 'switch back' or 'change' in the database.
Xano will notify you throughout your workspace when you have a test data source active.
By default all API requests use the live data source, however, you can change that with the following HTTP header below. Use this header in your API requests to define the data source:
For Enterprise users that have multiple data sources available, you would change the word test with the correct name for your data source you want to use with your API request.
The other method to make API requests use the test data source is through a URL argument. You can append the argument to your API endpoint URL.
This method is especially helpful for sending webhooks to your test data source when the webhook doesn't support additional headers.
Last modified 3mo ago