You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instructions/convex_rules.md
+6-11Lines changed: 6 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,3 @@
1
-
## description:
2
-
Guidelines and best practices for building Convex projects, including database schema design, queries, mutations, and real-world examples
3
-
4
-
5
1
# Convex guidelines
6
2
## Function guidelines
7
3
### New function syntax
@@ -94,7 +90,7 @@ Convex Type | TS/JS type | Example Usage | Validator for argument val
94
90
| Boolean | boolean |`true`|`v.boolean()`|
95
91
| String | string |`"abc"`|`v.string()`| Strings are stored as UTF-8 and must be valid Unicode sequences. Strings must be smaller than the 1MB total size limit when encoded as UTF-8. |
96
92
| Bytes | ArrayBuffer |`new ArrayBuffer(8)`|`v.bytes()`| Convex supports first class bytestrings, passed in as `ArrayBuffer`s. Bytestrings must be smaller than the 1MB total size limit for Convex types. |
97
-
| Array | Array]|`[1, 3.2, "abc"]`|`v.array(values)`| Arrays can have at most 8192 values. |
93
+
| Array | Array|`[1, 3.2, "abc"]`|`v.array(values)`| Arrays can have at most 8192 values. |
98
94
| Object | Object |`{a: "abc"}`|`v.object({property: value})`| Convex only supports "plain old JavaScript objects" (objects that do not have a custom prototype). Objects can have at most 1024 entries. Field names must be nonempty and not start with "$" or "_". |
99
95
| Record | Record |`{"a": "1", "b": "2"}`|`v.record(keys, values)`| Records are objects at runtime, but can have dynamic keys. Keys must be only ASCII characters, nonempty, and not start with "$" or "_". |
100
96
@@ -289,8 +285,9 @@ export default crons;
289
285
- The `ctx.storage.getUrl()` method returns a signed URL for a given file. It returns `null` if the file doesn't exist.
290
286
- Do NOT use the deprecated `ctx.storage.getMetadata` call for loading a file's metadata.
291
287
292
-
Instead, query the `_storage` system table. For example, you can use `ctx.db.system.get` to get an `Id<"_storage">`.
293
-
```
288
+
Instead, query the `_storage` system table. For example, you can use `ctx.db.system.get` to get an `Id<"_storage">`.
0 commit comments