no such function
This error occurs when you call a function that doesn't exist in SQLite. Some functions require extensions or aren't available in all SQLite builds.
The no such function error means you're calling a function SQLite doesn't recognize.
Understanding the Error
Error: no such function: NOW
The function NOW doesn't exist (SQLite uses different datetime functions).
Common Causes
1. Using Other Database Syntax
Functions from MySQL, PostgreSQL, etc.:
SQL
2. Extension Functions Not Loaded
Some functions need extensions:
SQL
3. Typos in Function Name
SQL
4. JSON Functions (Older SQLite)
SQL
How to Fix It
Solution 1: Use SQLite Equivalents
SQL
Solution 2: Load Extensions
JAVASCRIPT
SQL
Solution 3: Create Custom Functions
JAVASCRIPT
Solution 4: Check SQLite Version
SQL
JSON functions require 3.9+, many features improved in 3.25+, 3.35+, etc.
SQLite Core Functions
Always available:
ABS, CHANGES, CHAR, COALESCE, GLOB, HEX, IFNULL, IIF,
INSTR, LAST_INSERT_ROWID, LENGTH, LIKE, LIKELIHOOD,
LIKELY, LOWER, LTRIM, MAX, MIN, NULLIF, PRINTF, QUOTE,
RANDOM, RANDOMBLOB, REPLACE, ROUND, RTRIM, SOUNDEX,
SQLITE_VERSION, SUBSTR, TOTAL_CHANGES, TRIM, TYPEOF,
UNICODE, UNLIKELY, UPPER, ZEROBLOB
Best Practices
- Check SQLite documentation for available functions
- Use portable SQL if supporting multiple databases
- Check SQLite version for newer functions
- Create custom functions when needed
- Test on target environment before deployment