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

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 120+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> Every page on this site is available as Markdown by appending .md to its URL.

# portalSqliteCache

> Cache Solana Portal responses with SQLite in Pipes SDK.

Create SQLite cache for Portal responses. Use with `solanaPortalStream` to cache Portal API responses locally.

```ts theme={"system"}
portalSqliteCache(config: { path: string; compress?: boolean }): PortalCache
```

**Parameters:**

* `path`: Path to the SQLite database file. The parent directory is created if it does not exist.
* `compress`: Compress cached responses with zstd. Defaults to `true`.

**Example:**

```ts theme={"system"}
import { portalSqliteCache } from "@subsquid/pipes/portal-cache/node";
import { solanaQuery, solanaPortalStream } from "@subsquid/pipes/solana";

const source = solanaPortalStream({
  id: "cached-pipe",
  portal: "https://portal.sqd.dev/datasets/solana-mainnet",
  outputs: solanaQuery()
    .addFields({ block: { number: true, timestamp: true } })
    .includeAllBlocks()
    .build(),
  cache: portalSqliteCache({
    path: "./portal-cache.sqlite",
  }),
});
```

<Note>
  Import from `@subsquid/pipes/portal-cache/node` instead of `@subsquid/pipes/portal-cache`.
</Note>

### When to Use

* Development iteration
* Testing pipelines
* Repeated processing of same slot ranges.


## Related topics

- [portalSqliteCache](/en/sdk/pipes-sdk/evm/reference/utility-components/sqlite-cache.md)
- [Pipes SDK 1.0](/announcements/pipes-sdk-1-0.md)
- [A prod-ready pipe](/en/sdk/pipes-sdk/solana/prod-ready-pipe.md)
- [Stateful transforms](/en/sdk/pipes-sdk/evm/guides/advanced-topics/stateful-transforms.md)
- [Bitcoin portal stream](/en/sdk/pipes-sdk/bitcoin/reference/basic-components/source.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.