𝗛𝗼𝘄 𝘁𝗼 𝗨𝘀𝗲 𝗖𝘂𝘀𝘁𝗼𝗺 𝗦𝗤𝗟𝗶𝘁𝗲 𝗘𝘅𝘁𝗲𝗻𝘀𝗶𝗼𝗻𝘀 𝗶𝗻 𝗖𝗮𝗽𝗮𝗰𝗶𝘁𝗼𝗿

Standard SQLite works for most tasks. Sometimes you need more.

You might need a custom tokenizer for specific languages. You might need custom math functions or special text processing. These are called loadable extensions.

The Capacitor SQLite plugin supports these on Android and iOS.

Why use extensions?

The implementation differs by platform.

Android

Android system SQLite does not support loading extensions directly. You must use the requery backend.

iOS

iOS apps cannot load dynamic libraries at runtime. You must link your extension statically.

The C code for your extension stays the same. Only the build and registration steps change.

Once loaded, your custom extension works just like a built-in SQLite feature. You can use your new tokenizer or function in your SQL statements immediately.

Custom extensions give you the power of native code within your mobile database.

Source: https://dev.to/capawesome/how-to-use-custom-sqlite-extensions-in-capacitor-l5k