Skip to content

Mk Update index.mdx#30702

Open
mkmachinetool20 wants to merge 3 commits intocloudflare:productionfrom
mkmachinetool20:patch-1
Open

Mk Update index.mdx#30702
mkmachinetool20 wants to merge 3 commits intocloudflare:productionfrom
mkmachinetool20:patch-1

Conversation

@mkmachinetool20
Copy link
Copy Markdown

@mkmachinetool20 mkmachinetool20 commented May 8, 2026

export class MyDurableObject {
constructor(ctx, env) {
this.ctx = ctx;
this.storage = ctx.storage; // access to SQLite/KV/alarms
}

async fetch(request) {
// Handle requests — has access to in-memory state + durable storage
const value = this.ctx.storage.sql.exec("SELECT * FROM data");
return new Response(JSON.stringify(value.rows));
}
}

Summary

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

export class MyDurableObject {
  constructor(ctx, env) {
    this.ctx = ctx;
    this.storage = ctx.storage; // access to SQLite/KV/alarms
  }

  async fetch(request) {
    // Handle requests — has access to in-memory state + durable storage
    const value = this.ctx.storage.sql.exec("SELECT * FROM data");
    return new Response(JSON.stringify(value.rows));
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant