User-defined function
A user-defined function is a programmer-authored function that performs custom computation when invoked by an application, query, or data-processing system.
Server-Side WebAssembly
A user-defined function is a database function implemented by an application or extension rather than built into the database engine.
- How it is used
- Extends database capabilities with custom logic that executes beside the stored data.
- How deep it goes
- Explains locality, language flexibility, sandboxing, binary embedding, and SQL registration, but does not detail function implementation code.
- Examples
- Uses libSQL encryption and decryption functions registered from embedded Wasm binaries.
- What you can do after
- Operate/configure libSQL UDFs by building Wasm, generating a hex dump, and issuing CREATE FUNCTION statements.
Read how Server-Side WebAssembly explains user-defined function →
Statistics Slam Dunk
A user-defined function is a named, programmer-authored block of code that accepts inputs and returns a result or performs an operation.
- How it is used
- Creates reusable R calculations for repeated analytical tasks such as correlation conversion and Gini estimation.
- How deep it goes
- Defines names, arguments, bodies, return values, calls, and missing-argument behavior through short worked examples.
- Examples
- Uses correlation conversions, Gini estimation, Lorenz-curve values, returned results, and a missing-argument error.
- What you can do after
- Build it from scratch in R by defining functions, passing arguments, returning values, and reusing calculations.
Read how Statistics Slam Dunk explains user-defined function →
Also covered in
- Snowflake Data Engineering
- AI-Powered Developer: Build software with ChatGPT and Copilot
- Elasticsearch in Action, Second Edition
- Learn SQL in a Month of Lunches
What to know first
- SQLSQL is a standardized declarative language for defining, querying, and manipulating data in relational database systems.
Related concepts
- database functionkind of · A database function is a named routine stored or executed in a database that accepts inputs and computes a result, often a scalar or table-valued result.
- external access integrationconfigures · An external access integration is a Snowflake object that governs outbound access from Snowflake code to external network locations using specified network rules and secrets.
- function score queryused by · A function score query is an Elasticsearch compound query that modifies the relevance scores of matching documents with one or more scoring functions.
- libSQLuses · libSQL is an open-source, SQLite-compatible database engine that supports embedding and extending database functionality.
- requestsuses · Requests is a Python library that provides a high-level interface for sending HTTP requests and handling responses.
- stored procedurealternative to · A stored procedure is a named executable routine stored in a database and run by its database management system to perform operations.
Questions about user-defined function
What is user-defined function?
A user-defined function is a programmer-authored function that performs custom computation when invoked by an application, query, or data-processing system.
Which Manning books explain user-defined function?
Server-Side WebAssembly and Statistics Slam Dunk.
What should I know before learning user-defined function?
Manning books that teach user-defined function usually introduce SQL first.
What is the difference between user-defined function and stored procedure?
A user-defined function is a programmer-authored function that performs custom computation when invoked by an application, query, or data-processing system. A stored procedure is a named executable routine stored in a database and run by its database management system to perform operations.
What is user-defined function a kind of?
User-defined function is a kind of database function. A database function is a named routine stored or executed in a database that accepts inputs and computes a result, often a scalar or table-valued result.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

