Skip to main content
Module

x/sqlite3/src/database.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/src/database.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