sql.prepare is not a function in Durable Objects SQL

In Durable Objects SQL - I'm trying to test preparing statements, and I'm seeing that prepare is not a function . Is sql.prepare not available in Durable Objects SQL storage?
2 Replies
Chaika
Chaika5d ago
the api is documented here: https://developers.cloudflare.com/durable-objects/api/sql-storage/#exec and works different then d1's, yes there is no prepare
Cloudflare Docs
SQL Storage · Cloudflare Durable Objects docs
The SqlStorage interface encapsulates methods that modify the SQLite database embedded within a Durable Object. The SqlStorage interface is accessible via the sql property of DurableObjectStorage class.
jman
jmanOP5d ago
Ok, they share Typescript typings so I was confused. I saw that page, but I didn't see it mention that the two were actually different. I assumed that page was just a summary of the most common api's, and I should refer to d1 docs. Thank's for clarifying! :MeowHeartCloudflare:

Did you find this page helpful?