diff --git a/src/routes/docs/products/databases/tables/+page.markdoc b/src/routes/docs/products/databases/tables/+page.markdoc index f2daebbb0f..102e1516ea 100644 --- a/src/routes/docs/products/databases/tables/+page.markdoc +++ b/src/routes/docs/products/databases/tables/+page.markdoc @@ -48,7 +48,7 @@ const promise = tablesDB.createTable({ }, { key: 'name', - type: 'string', + type: 'varchar', size: 255, required: true }, @@ -165,7 +165,7 @@ let promise = tablesDB.createTable({ }, { key: 'name', - type: 'string', + type: 'varchar', size: 255, required: true }, @@ -284,7 +284,7 @@ $result = $tablesDB->createTable( ], [ 'key' => 'name', - 'type' => 'string', + 'type' => 'varchar', 'size' => 255, 'required' => true ], @@ -395,7 +395,7 @@ result = tablesDB.create_table( }, { 'key': 'name', - 'type': 'string', + 'type': 'varchar', 'size': 255, 'required': True }, @@ -504,7 +504,7 @@ response = tablesDB.create_table( }, { key: 'name', - type: 'string', + type: 'varchar', size: 255, required: true }, @@ -618,7 +618,7 @@ Table result = await tablesDB.CreateTable( new Dictionary { { "key", "name" }, - { "type", "string" }, + { "type", "varchar" }, { "size", 255 }, { "required", true } }, @@ -742,7 +742,7 @@ void main() { // Init SDK }, { 'key': 'name', - 'type': 'string', + 'type': 'varchar', 'size': 255, 'required': true }, @@ -858,7 +858,7 @@ val response = tablesDB.createTable( ), mapOf( "key" to "name", - "type" to "string", + "type" to "varchar", "size" to 255, "required" to true ), @@ -964,7 +964,7 @@ List> columns = Arrays.asList( }}, new HashMap() {{ put("key", "name"); - put("type", "string"); + put("type", "varchar"); put("size", 255); put("required", true); }}, @@ -1087,7 +1087,7 @@ let table = try await tablesDB.createTable( ], [ "key": "name", - "type": "string", + "type": "varchar", "size": 255, "required": true ], @@ -1226,7 +1226,10 @@ You can choose between the following types. | Column | Description | |--------------|------------------------------------------------------------------| -| `string` | String column. | +| `varchar` | String column. Fully indexable if size < 768. Maximum 16,383 characters. | +| `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. | | `float` | Float column. | | `boolean` | Boolean column. | @@ -1239,6 +1242,11 @@ You can choose between the following types. | `line` | Geographic line represented by an ordered list of coordinates. | | `polygon` | Geographic polygon representing a closed area; supports interior holes. | | `relationship` | Relationship column relates one table to another. [Learn more about relationships.](/docs/products/databases/relationships) | +| `string` | **Deprecated.** Use `varchar`, `text`, `mediumtext`, or `longtext` instead. | + +{% info title="Migrating from string columns" %} +The `string` type is deprecated. Internally, `string` columns dynamically switch between `varchar`, `text`, `mediumtext`, and `longtext` based on the size you specify. Existing `string` columns will change to the appropriate text type based on the size of the existing column. +{% /info %} If an column must be populated in all rows, set it as `required`. If not, you may optionally set a default value.