Skip to content
Draft
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
30 changes: 19 additions & 11 deletions src/routes/docs/products/databases/tables/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const promise = tablesDB.createTable({
},
{
key: 'name',
type: 'string',
type: 'varchar',
size: 255,
required: true
},
Expand Down Expand Up @@ -165,7 +165,7 @@ let promise = tablesDB.createTable({
},
{
key: 'name',
type: 'string',
type: 'varchar',
size: 255,
required: true
},
Expand Down Expand Up @@ -284,7 +284,7 @@ $result = $tablesDB->createTable(
],
[
'key' => 'name',
'type' => 'string',
'type' => 'varchar',
'size' => 255,
'required' => true
],
Expand Down Expand Up @@ -395,7 +395,7 @@ result = tablesDB.create_table(
},
{
'key': 'name',
'type': 'string',
'type': 'varchar',
'size': 255,
'required': True
},
Expand Down Expand Up @@ -504,7 +504,7 @@ response = tablesDB.create_table(
},
{
key: 'name',
type: 'string',
type: 'varchar',
size: 255,
required: true
},
Expand Down Expand Up @@ -618,7 +618,7 @@ Table result = await tablesDB.CreateTable(
new Dictionary<string, object>
{
{ "key", "name" },
{ "type", "string" },
{ "type", "varchar" },
{ "size", 255 },
{ "required", true }
},
Expand Down Expand Up @@ -742,7 +742,7 @@ void main() { // Init SDK
},
{
'key': 'name',
'type': 'string',
'type': 'varchar',
'size': 255,
'required': true
},
Expand Down Expand Up @@ -858,7 +858,7 @@ val response = tablesDB.createTable(
),
mapOf(
"key" to "name",
"type" to "string",
"type" to "varchar",
"size" to 255,
"required" to true
),
Expand Down Expand Up @@ -964,7 +964,7 @@ List<Map<String, Object>> columns = Arrays.asList(
}},
new HashMap<String, Object>() {{
put("key", "name");
put("type", "string");
put("type", "varchar");
put("size", 255);
put("required", true);
}},
Expand Down Expand Up @@ -1087,7 +1087,7 @@ let table = try await tablesDB.createTable(
],
[
"key": "name",
"type": "string",
"type": "varchar",
"size": 255,
"required": true
],
Expand Down Expand Up @@ -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. |
Expand All @@ -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.
Expand Down