Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/routes/changelog/(entries)/2026-05-06.markdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
layout: changelog
title: "Databases: BigInt column support"
date: 2026-05-06
---

Appwrite Databases now supports **BigInt** columns (and legacy attributes), giving you a 64-bit signed integer type alongside the existing 32-bit `integer`. Use BigInt when your values may exceed the ±2.1 billion range of a regular integer — for example, large counters, high-resolution timestamps, or external IDs from systems that use 64-bit keys.

BigInt columns accept optional `min`, `max`, and `default` parameters and work with atomic increment/decrement operations, just like regular integers.

**TablesDB (recommended)**
```js
columns: [
{
key: 'total_views',
type: 'bigint',
required: false,
min: 0
}
]
```

**Legacy Collections API**
```js
// createBigIntAttribute is also available
databases.createBigintAttribute(
Comment on lines +25 to +26
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The comment says createBigIntAttribute (capital I) but the actual function call on the next line uses createBigintAttribute (lowercase i). These look like two different method names, which could confuse readers into thinking a second variant exists. One of them needs to match the real SDK method name.

Suggested change
// createBigIntAttribute is also available
databases.createBigintAttribute(
// createBigintAttribute
databases.createBigintAttribute(

databaseId, collectionId, 'total_views',
false, // required
0, // min
null, // max
null // default
);
```

{% arrow_link href="/docs/products/databases/tables#columns" %}
Learn more about column types
{% /arrow_link %}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ description: Safely increment and decrement numeric fields without race conditio

Atomic numeric operations allow you to safely increase or decrease numeric fields without fetching the full row. This eliminates race conditions and reduces bandwidth usage when updating any numeric values that need to be modified atomically, such as counters, scores, balances, and other fast-moving numeric data.

These operations work with `integer`, `bigint`, and `float` columns. Use `bigint` columns when your counters or accumulators may exceed the 32-bit integer range.

# How atomic operations work {% #how-atomic-operations-work %}

Instead of the traditional read-modify-write pattern, atomic numeric operations use dedicated methods to modify values directly on the server. The server applies the change atomically under concurrency control and returns the new value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ You can choose between the following types.
| Attribute | Description |
|--------------|------------------------------------------------------------------|
| `string` | String attribute. |
| `integer` | Integer attribute. |
| `integer` | Integer attribute. 32-bit signed. |
| `bigint` | Big integer attribute. 64-bit signed, for values beyond 32-bit integer range. |
| `float` | Float attribute. |
| `boolean` | Boolean attribute. |
| `datetime` | Datetime attribute formatted as an ISO 8601 string. |
Expand Down
59 changes: 58 additions & 1 deletion src/routes/docs/products/databases/tables/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ const promise = tablesDB.createTable({
type: 'float',
required: false
},
{
key: 'total_views',
type: 'bigint',
required: false
},
{
key: 'is_active',
type: 'boolean',
Expand Down Expand Up @@ -209,6 +214,11 @@ let promise = tablesDB.createTable({
type: 'float',
required: false
},
{
key: 'total_views',
type: 'bigint',
required: false
},
{
key: 'is_active',
type: 'boolean',
Expand Down Expand Up @@ -343,6 +353,11 @@ $result = $tablesDB->createTable(
'type' => 'float',
'required' => false
],
[
'key' => 'total_views',
'type' => 'bigint',
'required' => false
],
[
'key' => 'is_active',
'type' => 'boolean',
Expand Down Expand Up @@ -469,6 +484,11 @@ result = tablesDB.create_table(
'type': 'float',
'required': False
},
{
'key': 'total_views',
'type': 'bigint',
'required': False
},
{
'key': 'is_active',
'type': 'boolean',
Expand Down Expand Up @@ -593,6 +613,11 @@ response = tablesDB.create_table(
type: 'float',
required: false
},
{
key: 'total_views',
type: 'bigint',
required: false
},
{
key: 'is_active',
type: 'boolean',
Expand Down Expand Up @@ -728,6 +753,12 @@ Table result = await tablesDB.CreateTable(
{ "required", false }
},
new Dictionary<string, object>
{
{ "key", "total_views" },
{ "type", "bigint" },
{ "required", false }
},
new Dictionary<string, object>
{
{ "key", "is_active" },
{ "type", "boolean" },
Expand Down Expand Up @@ -864,6 +895,11 @@ void main() { // Init SDK
'type': 'float',
'required': false
},
{
'key': 'total_views',
'type': 'bigint',
'required': false
},
{
'key': 'is_active',
'type': 'boolean',
Expand Down Expand Up @@ -995,6 +1031,11 @@ val response = tablesDB.createTable(
"type" to "float",
"required" to false
),
mapOf(
"key" to "total_views",
"type" to "bigint",
"required" to false
),
mapOf(
"key" to "is_active",
"type" to "boolean",
Expand Down Expand Up @@ -1116,6 +1157,11 @@ List<Map<String, Object>> columns = Arrays.asList(
put("type", "float");
put("required", false);
}},
new HashMap<String, Object>() {{
put("key", "total_views");
put("type", "bigint");
put("required", false);
}},
new HashMap<String, Object>() {{
put("key", "is_active");
put("type", "boolean");
Expand Down Expand Up @@ -1254,6 +1300,11 @@ let table = try await tablesDB.createTable(
"type": "float",
"required": false
],
[
"key": "total_views",
"type": "bigint",
"required": false
],
[
"key": "is_active",
"type": "boolean",
Expand Down Expand Up @@ -1383,6 +1434,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"type": "float",
"required": false
}),
json!({
"key": "total_views",
"type": "bigint",
"required": false
}),
json!({
"key": "is_active",
"type": "boolean",
Expand Down Expand Up @@ -1516,7 +1572,8 @@ You can choose between the following types.
| `text` | Text column. Prefix indexing only. Maximum 16,383 characters. |
| `mediumtext` | Text column. Prefix indexing only. Maximum 4,194,303 characters. |
| `longtext` | Text column. Prefix indexing only. Maximum 1,073,741,823 characters. |
| `integer` | Integer column. |
| `integer` | Integer column. 32-bit signed, range -2,147,483,648 to 2,147,483,647. |
| `bigint` | Big integer column. 64-bit signed, range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Ideal for timestamps, large counters, or IDs that exceed 32-bit limits. |
| `float` | Float column. |
| `boolean` | Boolean column. |
| `datetime` | Datetime column formatted as an ISO 8601 string. |
Expand Down
Loading