Skip to content

Conversation

@atharvadeosthale
Copy link
Member

@atharvadeosthale atharvadeosthale commented Jan 19, 2026

Summary by CodeRabbit

  • Documentation
    • Introduced explicit string column types: varchar, text, mediumtext, longtext, with guidance on sizes and indexing.
    • Updated examples and SDK snippets to use varchar in place of the legacy string type.
    • Added example column definitions for bio (text), content (mediumtext), and data (longtext) with optional/required usage.
    • Added a deprecation notice for the legacy string column type and refreshed related examples.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR updates Markdoc documentation: it replaces string with varchar across SDK/code samples, adds new column examples bio (text), content (mediumtext), and data (longtext) with optional/required flags, and adds a deprecation note recommending varchar, text, mediumtext, or longtext instead of string. It also adds a new blog post describing the new string types. No runtime behavior or exported/public API declarations changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding new string types (varchar, text, mediumtext, longtext) documentation to the tables section, which aligns with the core modifications across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch new-string-types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/routes/docs/products/databases/tables/`+page.markdoc:
- Around line 1245-1249: Update the doc to stop showing deprecated `string` in
examples and clarify migration rules: change any example columns using `type:
'string'` to a recommended replacement such as `type: 'varchar'` (or
`text`/`mediumtext`/`longtext` as appropriate) and edit the "Migrating from
string columns" info block to state explicitly whether the migration chooses the
resulting text type based on the declared column size (e.g., the `size` option
you specify) versus the size of existing row data—if the implementation uses the
declared size, say "based on the declared size (`size` option)"; if it inspects
actual data, say "based on the maximum size of existing data"—so consumers and
examples (e.g., snippets that previously used `type: 'string'`) are consistent
with the guidance.
🧹 Nitpick comments (1)
src/routes/docs/products/databases/tables/+page.markdoc (1)

1227-1232: Clarify how varchar vs text should be chosen.

Both rows show the same 16,383-character limit and near-identical descriptions (Line 1229–1232), which makes the selection criteria unclear. Consider adding a short note distinguishing intended usage (e.g., varchar requires a size, text is for longer prose), or adjust limits if they differ.

@atharvadeosthale atharvadeosthale marked this pull request as draft January 19, 2026 10:54
@atharvadeosthale atharvadeosthale marked this pull request as ready for review February 3, 2026 11:57
…into new-string-types

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/routes/blog/post/new-string-types/`+page.markdoc:
- Line 23: Update the table row that currently reads "`varchar` | 16,383 | Fully
indexable if size < 768" to explicitly state the unit as bytes and note the
encoding/setting caveats: say something like "Fully indexable if size < 768
bytes (InnoDB index limit); with innodb_large_prefix or Barracuda this can be
larger; with utf8mb4 (4 bytes/char) the max indexable characters is ~192 chars."
Also fix the conflicting sentence that says "768 characters" so it instead
references "768 bytes" and mention the effective character limit varies by
character set (e.g., utf8mb4 = 4 bytes/char).
- Line 6: The frontmatter "cover" property in the Markdoc post (+page.markdoc)
points to the wrong image (/images/blog/announcing-screenshots-api/cover.png);
update the cover frontmatter to reference this post's dedicated cover image
(e.g., /images/blog/new-string-types/cover.png or the correct asset name) so the
file's cover property matches the post's images.


| Type | Max characters | Indexing |
|--------------|-------------------|-----------------------------------------------|
| `varchar` | 16,383 | Fully indexable if size < 768 |
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify "if size < 768" — characters or bytes?

The table states varchar is "Fully indexable if size < 768" but doesn't specify the unit. Line 32 says "768 characters," but the underlying MariaDB/InnoDB index limit is 768 bytes (or 3072 bytes with innodb_large_prefix). With multi-byte encodings (e.g., utf8mb4 at 4 bytes/char), the effective character limit for full indexing would be much lower. Please verify the correct threshold and unit.

🤖 Prompt for AI Agents
In `@src/routes/blog/post/new-string-types/`+page.markdoc at line 23, Update the
table row that currently reads "`varchar` | 16,383 | Fully indexable if size <
768" to explicitly state the unit as bytes and note the encoding/setting
caveats: say something like "Fully indexable if size < 768 bytes (InnoDB index
limit); with innodb_large_prefix or Barracuda this can be larger; with utf8mb4
(4 bytes/char) the max indexable characters is ~192 chars." Also fix the
conflicting sentence that says "768 characters" so it instead references "768
bytes" and mention the effective character limit varies by character set (e.g.,
utf8mb4 = 4 bytes/char).

featured: false
---

Until now, Appwrite offered a single `string` column type that internally switched between four different storage types based on the size you specified. This meant you had no visibility into how your data was actually stored, how it could be indexed, or why certain size limits existed.
Copy link
Member

Choose a reason for hiding this comment

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

I would use abstracted instead of switch or in addition


# Why we made this change

We regularly dogfood Appwrite in our own projects to find areas we can improve. While building [Imagine](https://imagine.dev), our AI-powered builder for web apps, which uses Appwrite under the hood for out-of-the-box server functionality, we quickly noticed how hard it is for AI models to reason about the `string` column type. Here's what we found.
Copy link
Member

Choose a reason for hiding this comment

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

We can share the Imagine story, but I think this confusion came from humans engineers before agents struggled with it. So we made the fix for both - win win


# Deprecation of the string type

The `string` column type is now deprecated. It will continue to work for existing columns, but we recommend using the explicit types for all new columns going forward.
Copy link
Member

Choose a reason for hiding this comment

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

I would make it clearer that we plan to continue backward support just to avoid any confusion even if its clear, we can make x2 clear.


We saw this firsthand with Imagine. Imagine runs an Appwrite Cloud agent that provisions database resources on your behalf using the Appwrite CLI and `appwrite.json` as the schema. The agent is trained to build sophisticated architectures, and it would easily create just enough string columns to hit the row width limit.

We could have solved this with better prompting, but that would only fix Imagine. We wanted to improve the experience for everyone, whether you're using AI tooling, the Console, or the SDKs directly. With explicit types, an AI model now naturally picks `longtext` for something like blog content, which is stored off-page and doesn't consume row space.
Copy link
Member

Choose a reason for hiding this comment

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

I'm missing something about the lack of visibility of the varchar row size limit, I think this was the root issue with the first approach. Now we make things more visible (even on the console) and help devs and agents alike make better decisions around their desired data structures.


We saw this firsthand with Imagine. Imagine runs an Appwrite Cloud agent that provisions database resources on your behalf using the Appwrite CLI and `appwrite.json` as the schema. The agent is trained to build sophisticated architectures, and it would easily create just enough string columns to hit the row width limit.

We could have solved this with better prompting, but that would only fix Imagine. We wanted to improve the experience for everyone, whether you're using AI tooling, the Console, or the SDKs directly. With explicit types, an AI model now naturally picks `longtext` for something like blog content, which is stored off-page and doesn't consume row space.
Copy link
Member

Choose a reason for hiding this comment

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

Imagine use cases is great, but the human use case should get here equal attention. It should be 50:50


# Why we made this change

The root issue with the legacy `string` type was a lack of visibility. It abstracted away important storage details, which meant developers had no way to make informed decisions about their data structures. This led to problems for both human engineers and AI agents alike.
Copy link
Member

Choose a reason for hiding this comment

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

I would maybe add a bit more context to why we made this decision from the first place and be honest about us realizing that it compromised on important details like visibility and enough control to devs. We can also mention that finding the right abstraction balance is a difficult task, and from time to time based on user feedback and experience we have to adjust and respond which is what were doing now.

@atharvadeosthale atharvadeosthale merged commit 57de9c6 into main Feb 12, 2026
5 checks passed
@atharvadeosthale atharvadeosthale deleted the new-string-types branch February 12, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants