Skip to Main Content
The Definitive Guide to SQLite
book

The Definitive Guide to SQLite

by Michael Owens
May 2006
Intermediate to advanced content levelIntermediate to advanced
462 pages
13h 19m
English
Apress
Content preview from The Definitive Guide to SQLite

CHAPTER 7The Extension C API

This chapter is about teaching SQLite new tricks. The previous chapter dealt with generic database work; this chapter is about being creative. The latter half of the API—the Extension API—offers three basic ways to extend (or customize) SQLite, through the creation of user-defined functions, aggregates, and collation sequences.

User-defined functions are SQL functions that map to some implementation that you write. They are callable from within SQL. For example, you could create a function hello_newman() that returns the string 'Hello Jerry' and, once it is registered, call it from SQL as follows:

sqlite > select hello_newman() as reply; reply ------------------ 'Hello Jerry'

This is a special version of the SQLite ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Definitive Guide to SQLite, Second Edition

The Definitive Guide to SQLite, Second Edition

Grant Allen, Mike Owens
Using SQLite

Using SQLite

Jay A. Kreibich
SQLite

SQLite

Chris Newman

Publisher Resources

ISBN: 9781590596739Purchase book