# RocksetLoader

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/document_loaders/rocksetdb/RocksetLoader)

Load from a `Rockset` database.

To use, you should have the `rockset` python package installed.

## Signature

```python
RocksetLoader(
    self,
    client: Any,
    query: Any,
    content_keys: List[str],
    metadata_keys: Optional[List[str]] = None,
    content_columns_joiner: Callable[[List[Tuple[str, Any]]], str] = default_joiner,
)
```

## Description

**Example:**

.. code-block:: python

    # This code will load 3 records from the "langchain_demo"
    # collection as Documents, with the `text` column used as
    # the content

    from langchain_community.document_loaders import RocksetLoader
    from rockset import RocksetClient, Regions, models

    loader = RocksetLoader(
        RocksetClient(Regions.usw2a1, "<api key>"),
        models.QueryRequestSql(
            query="select * from langchain_demo limit 3"
        ),
        ["text"]
    )
)

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `client` | `Any` | Yes | Rockset client object. |
| `query` | `Any` | Yes | Rockset query object. |
| `content_keys` | `List[str]` | Yes | The collection columns to be written into the `page_content` of the Documents. |
| `metadata_keys` | `Optional[List[str]]` | No | The collection columns to be written into the `metadata` of the Documents. By default, this is all the keys in the document. (default: `None`) |
| `content_columns_joiner` | `Callable[[List[Tuple[str, Any]]], str]` | No | Method that joins content_keys and its values into a string. It's method that takes in a List[Tuple[str, Any]]], representing a list of tuples of (column name, column value). By default, this is a method that joins each column value with a new line. This method is only relevant if there are multiple content_keys. (default: `default_joiner`) |

## Extends

- `BaseLoader`

## Constructors

```python
__init__(
    self,
    client: Any,
    query: Any,
    content_keys: List[str],
    metadata_keys: Optional[List[str]] = None,
    content_columns_joiner: Callable[[List[Tuple[str, Any]]], str] = default_joiner,
)
```

| Name | Type |
|------|------|
| `client` | `Any` |
| `query` | `Any` |
| `content_keys` | `List[str]` |
| `metadata_keys` | `Optional[List[str]]` |
| `content_columns_joiner` | `Callable[[List[Tuple[str, Any]]], str]` |


## Properties

- `client`
- `query`
- `content_keys`
- `content_columns_joiner`
- `metadata_keys`
- `paginator`
- `request_model`

## Methods

- [`lazy_load()`](https://reference.langchain.com/python/langchain-community/document_loaders/rocksetdb/RocksetLoader/lazy_load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/document_loaders/rocksetdb.py#L20)