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

# Query a tabular store

<Note>
  Ensure that the API is available in your workspace environment; see [Install the Data API](/cloud/reference/api/data_api/install_the_data_api) for setup information.
</Note>

## Authentication

The Datasource client uses environment variables available in the workspace to automatically authenticate your identity.

To override this behavior, see [Custom Authentication](/cloud/reference/api/data_api/datasource_usecases/custom_auth).

## Usage

Assuming a data source named `redshift-test` is configured with valid credentials for the current user:

```python theme={null}
from domino.data_sources import DataSourceClient

# instantiate a client and fetch the datasource instance
redshift = DataSourceClient().get_datasource("redshift-test")

query = """
     SELECT
         firstname,
         lastname,
         age
     FROM
         employees
     LIMIT 1000
 """

 # res is a simple wrapper of the query result
 res = redshift.query(query)
 # to_pandas() loads the result into a pandas dataframe
 df = res.to_pandas()
 # check the first 10 rows
 df.head(10)
```

```r theme={null}
library(DominoDataR)
client <- DominoDataR::datasource_client()

query <- "
  SELECT
    firstname,
    lastname,
    age
  FROM
    employees
  LIMIT 1000"

# table is a https://arrow.apache.org/docs/r/reference/Table-class.html
table <- DominoDataR::query(client, "redshift-test", query)
#> Table
#> 1000 rows x 3 columns
#> $firstname <string not null>
#> $lastname <string not null>
#> $age <int32 not null>
```
