Environment Declarations
Environment bindings are how Cloesce manages, references, and injects Cloudflare Workers bindings in your application.
Currently, Cloesce supports D1, KV, R2, Durable Objects, and Wrangler Environment Variables.
By defining these bindings in your schema, you enable Cloesce to:
- Describe Models composed of data stored in these bindings.
- Generate a Wrangler configuration for each binding.
- Generate a fully typed interface for interacting with each binding in your application code.
- Handle database migrations
Tip
In this alpha, any top level declaration in Cloesce is global across any file in the project.
This means that environment bindings declared in one file can be referenced and used in any other file.