> For the complete documentation index, see [llms.txt](https://docs.checkpoint.snapshot.box/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.checkpoint.snapshot.box/guides/bigint-and-bigdecimal.md).

# BigInt and BigDecimal

Checkpoint provides support for `BigInt`, `Decimal`, `BigDecimal`. It's also possible to define custom (or define existing) decimal types.

### PostgreSQL mappings

BigInt and BigDecimal types are mapped to following PostgreSQL types by default:

* `BigInt` -> `bigint`
* `Decimal` -> `decimal(10, 2)`
* `BigDecimal` -> decimal`(20, 8)`

### Using BigInt and BigDecimal types

To use default (or custom) BigInt and BigDecimal type it needs to be predeclared in GraphQL schema using `scalar` keyword. Once it's declared it can be used as field's type.

```graphql
scalar BigInt

type User {
  votes_count: BigInt
}  
```

### Custom decimal types

It's possible to define new or to redefine existing decimal types using overrides. This file should be called overrides.json and stored in your source directory.

```json
{
  "decimal_types": {
    "BigDecimalVP": {
      "p": 60,
      "d": 0
    }
  }
}

```

{% hint style="info" %}
When you use custom decimal types your decimal types need to be static and stored in overrides.json file. This is because it's used in codegen process of ORM.
{% endhint %}

You can then pass those to Checkpoint via options:

```typescript
import overridesConfig from './overrides.json';

// ...

const checkpoint = new Checkpoint(schema, {
  overridesConfig
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.checkpoint.snapshot.box/guides/bigint-and-bigdecimal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
