> ## 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.

# TypeORM model generation

> Generate TypeORM models from a Squid SDK schema.graphql file

TypeORM entities can be automatically generated from the [schema file](./schema-files/schema-files-codegen) defined in `schema.graphql`.
The tool is called [`squid-typeorm-codegen(1)`](https://github.com/subsquid/squid-sdk/tree/master/typeorm/typeorm-codegen) and has no additional options.

Install with

```bash theme={"system"}
npm i @subsquid/typeorm-codegen --save-dev
```

Invoke with

```bash theme={"system"}
npx squid-typeorm-codegen
```

The input can be `schema.graphql` or a `schema/` directory containing multiple
`.graphql` files. Models are written to `src/model/generated` as
`<entity>.model.ts` files and import the column decorators they need from
`@subsquid/typeorm-store`. Generated index names are deterministic and are
shortened when needed to stay within PostgreSQL's identifier limit.


## Related topics

- [TypeORM model generation](/en/sdk/squid-sdk/evm/reference/typeorm-codegen.md)
- [CLI Cheatsheet](/en/sdk/squid-sdk/substrate/guides/advanced/cli-cheatsheet.md)
- [TypeORM migration generation](/en/sdk/squid-sdk/solana/reference/typeorm-migration.md)


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