Skip to content

SqlExecutor

type SqlExecutor = <T>(strings, ...values) => T[];

SQL executor type matching Cloudflare’s Durable Object sql binding.

Returns rows directly as an array — NOT an object with .toArray(). This was a long-standing type bug that surfaced today when the voice path started routing through OrchestrationStore.get(): SQL returned an array but code called .toArray() on it, throwing TypeError.

Verified against the cloudflare/agents base class at packages/agents/src/index.ts:881-888const result = this.sql... followed by result.length/result[0] with no .toArray() anywhere.

Type Parameter Default type

T

unknown

Parameter Type

strings

TemplateStringsArray

values

unknown[]

T[]