Skip to main content
EdgeSpark uses a declarative workflow for app tables, storage buckets, runtime keys, and auth config. The source of truth is your repo, not a dashboard editor. Agents should edit repo-authored defs, generate migrations, apply declarative config, pull generated SDK types when needed, and never hand-write platform types.

Files to read before writing code

Every EdgeSpark project has two important categories of files:
Never edit files in server/src/__generated__/. They are overwritten by pull commands.

Commands you should use

1

Read repo-authored defs

Start with server/src/defs/db_schema.ts, server/src/defs/storage_schema.ts, and server/src/defs/runtime.ts. These files tell you what the app intends to own.
2

Read generated runtime types

Open server/src/__generated__/edgespark.d.ts and server/src/__generated__/server-types.d.ts before using runtime SDK imports. Do not guess import names or method signatures.
3

Update schema or buckets in code

Add tables in db_schema.ts, relations in db_relations.ts, buckets in storage_schema.ts, and runtime key names in runtime.ts.
4

Run the matching sync command

5

Write handlers against typed imports

server/src/index.ts
6

Type check before deploy

When to pull

Use edgespark pull schema when you need the latest platform-managed tables or system metadata in server/src/__generated__/. Use edgespark pull types when runtime SDK types may be stale. In automation or CI, use:

See also

Use the database

How to define schema, generate migrations, and query D1 in the current scaffold.

Handling errors

How to fix stale types, migration issues, and deploy failures.
Last modified on April 7, 2026