You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Database` may also be run in `autoWait` mode, such that each mutating call will not resolve until it has finalized on the Tableland network. This is useful when working with D1 compatible libraries, or to avoid issues with nonce-reuse etc.
251
251
252
-
Additionally, all async method calls take an optional `AbortSignal`object, which may be used to cancel or otherwise abort an inflight query. Note that this will only abort queries (including wait status), not the actual mutation transaction itself.
252
+
Additionally, all async method calls take an optional `Signal` or `PollingController`object, which may be used to abort an inflight query. Note that this will only abort queries (including wait status), not the actual mutation transaction itself.
253
253
254
254
```typescript
255
-
const controller =newAbortController();
256
-
constsignal=controller.signal;
255
+
import { helpers } from"@tableland/sdk";
256
+
constcontroller=helpers.createPollingController(60_000, 1500); // polling timeout and interval
257
257
258
258
const stmt =db.prepare("SELECT name, age FROM users WHERE age < ?1");
259
259
260
260
setTimeout(() =>controller.abort(), 10);
261
-
const young =awaitstmt.bind(20).all({ signal });
261
+
const young =awaitstmt.bind(20).all(undefined, controller);
0 commit comments