the universal sandbox runtime for agents and humans.
pocketenv.io
sandbox
openclaw
agent
claude-code
vercel-sandbox
deno-sandbox
cloudflare-sandbox
atproto
sprites
daytona
1import { type InferInsertModel, type InferSelectModel, sql } from "drizzle-orm";
2import { pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
3import sandboxes from "./sandboxes";
4
5const services = pgTable(
6 "services",
7 {
8 id: text("id").primaryKey().default(sql`xata_id()`),
9 sandboxId: text("sandbox_id")
10 .notNull()
11 .references(() => sandboxes.id, { onDelete: "cascade" }),
12 name: text("name").notNull(),
13 command: text("command").notNull(),
14 description: text("description"),
15 serviceId: text("service_id"),
16 status: text("status").notNull().default("STOPPED"),
17 createdAt: timestamp("created_at").defaultNow().notNull(),
18 updatedAt: timestamp("updated_at").defaultNow().notNull(),
19 },
20 (t) => [uniqueIndex("unique_sandbox_service").on(t.name, t.sandboxId)],
21);
22
23export type SelectService = InferSelectModel<typeof services>;
24export type InsertService = InferInsertModel<typeof services>;
25
26export default services;