method
bun.ReservedSQL.file
filename: string,
values?: any[] | Record<string, any>
Reads a file and runs its contents as a query. The query is lazy: Bun reads the file when the query starts. Pass values as an array if the file uses positional parameters ($1 on PostgreSQL, ? on MySQL). With the SQLite adapter, values may also be an object of named parameters (:name, $name, or @name placeholders). A key works with or without the prefix.
const result = await sql.file("query.sql", [1, 2, 3]);