SQL database handle available to tool execute code when storage is enabled for the app. Backed by the app's Supabase Postgres schema.
execute
import type { ToolContext } from "@alexkroman1/aai";declare const ctx: ToolContext; // the context a tool's execute receivesawait ctx.db.query("insert into notes (body) values ($1)", ["hello"]);const rows = await ctx.db.query<{ body: string }>("select body from notes"); Copy
import type { ToolContext } from "@alexkroman1/aai";declare const ctx: ToolContext; // the context a tool's execute receivesawait ctx.db.query("insert into notes (body) values ($1)", ["hello"]);const rows = await ctx.db.query<{ body: string }>("select body from notes");
Run one parameterized SQL statement ($1, $2… placeholders). Resolves with the result rows.
Optional
SQL database handle available to tool
executecode when storage is enabled for the app. Backed by the app's Supabase Postgres schema.Example