Files to read before writing code
Every EdgeSpark project has two important categories of files:Commands you should use
Recommended workflow
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
Useedgespark 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.