> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytebase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Source Restriction

You may select data sources between the admin and [read-only connection](/get-started/instance/#read-only-connection) while running SQL queries in SQL Editor.

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/settings/bb-sql-editor-data-source.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=74e362bba138604c470a5487683a23f0" alt="bb-sql-editor-data-source" width="920" height="496" data-path="content/docs/sql-editor/settings/bb-sql-editor-data-source.webp" />

The **Admin Data Source Query Restrictions** could be set either by environment or project level.

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/settings/bb-data-source-env.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=f71780ccbe42b665478add030f592268" alt="bb-data-source-env" width="1666" height="790" data-path="content/docs/sql-editor/settings/bb-data-source-env.webp" />

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/settings/bb-data-source-project.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=94dcc4c7eb9b85bb4935aa75b725c166" alt="bb-data-source-project" width="1670" height="870" data-path="content/docs/sql-editor/settings/bb-data-source-project.webp" />

If both are set, the higher restriction will be applied. The order of restriction level from high to low is as follows:

1. ON
   * Disallow querying data from the admin data source
   * Fallback to the admin data source if no read-only data source is available
2. Off
