import { PreparedQuery } from "https://deno.land/x/sqlite@v3.4.0/src/query.ts";
Binds the given parameters to the query and returns an iterator over rows.
Using an iterator avoids loading all returned rows into memory and hence allows to process a large number of rows.
Example:
const query = db.prepareQuery<[number, string]>("SELECT id, name FROM people");
for (const [id, name] of query.iter()) {
// ...
}
Calling iter
invalidates any iterators previously returned
from this prepared query. Using an invalidated iterator is a bug.
To avoid SQL injection, user-provided values should always be passed to the database through a query parameter.
See QueryParameterSet
for documentation on
how values can be bound to SQL statements.
See QueryParameter
for documentation on how
values are returned from the database.