Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/sqlite3/mod.ts>Database#function

The fastest and correct SQLite3 module for Deno runtime
Latest
method Database.prototype.function
import { Database } from "https://deno.land/x/sqlite3@0.12.0/mod.ts";

Creates a new user-defined function.

Example:

db.function("add", (a: number, b: number) => a + b);
db.prepare("select add(1, 2)").value<[number]>()!; // [3]

Parameters

name: string
fn: CallableFunction
optional
options: FunctionOptions