@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
mdx 57 lines 1.56 KB
Raw
1 ---
2 title: Groups
3 description: Turso groups decide where your databases run.
4 ---
5
6 Every Turso database belongs to a group. The group decides where its databases run.
7
8 ## Create a group
9
10 ```typescript
11 const group = yield* Turso.Group("Group", { location: "aws-us-east-1" });
12 ```
13
14 `location` defaults to `aws-us-east-1`. Run `turso db locations` to see the others.
15
16 Changing `location` creates a new group. The old group and its databases are deleted.
17
18 ## Name it
19
20 ```typescript
21 const group = yield* Turso.Group("Group", {
22 name: "production",
23 location: "aws-eu-west-1",
24 });
25 ```
26
27 Without `name`, Alchemy picks one for each stage. Names must be unique in your organization.
28
29 ## Enable extensions
30
31 ```typescript
32 const group = yield* Turso.Group("Group", { extensions: "all" });
33 ```
34
35 Pass `"all"` or a list of extension names. Changing `extensions` creates a new group.
36
37 ## Protect it from deletion
38
39 ```typescript
40 const group = yield* Turso.Group("Group", { deleteProtection: true });
41 ```
42
43 While this is on, you can't destroy the group. Set it to `false` and deploy first.
44
45 ## Delete a group
46
47 Destroying a group deletes every database in it, including ones your app created with [ManageDatabases](/turso/database-per-tenant).
48
49 ## Replicas
50
51 `replicas` adds read-only copies in other locations. Groups on AWS don't support this. It only works for older groups hosted on Fly.
52
53 ## Where next
54
55 - [Databases](/turso/databases)
56 - [Tokens](/turso/tokens) — a [GroupToken](/turso/tokens#a-token-for-a-whole-group) works for every database in a group
57 - [Group reference](/providers/turso/reference/group)