Name

SPVM::Resource::SQLite - A resource that provides the SQLite header and source code.

Description

SPVM::Resource::SQLite in SPVM is a resource class for SQLite.

Usage

MyClass.config:

my $config = SPVM::Builder::Config->new_c99;
$config->use_resource('Resource::SQLite');
$config;

MyClass.c:

#include "sqlite3.h"

int32_t SPVM__MyClass__test(SPVM_ENV* env, SPVM_VALUE* stack) {
  
  const char* version = sqlite3_libversion();
  
  return 0;
}

Original Product

SQLite

Original Product Version

SQLite 3.45.1 (Amalgamation)

Language

C

Language Standard

C99

Header Files

  • sqlite3.h

  • sqlite3ext.h

Source Files

  • sqlite3.c

Compiler Flags

  • -DSQLITE_THREADSAFE=1

    Enables multi-thread support.

  • -DSQLITE_ENABLE_COLUMN_METADATA

    Enables APIs that provide column metadata, required by many database drivers.

  • -DSQLITE_ENABLE_FTS5

    Enables the Full-Text Search engine version 5.

  • -DSQLITE_ENABLE_RTREE

    Enables the R*Tree index extension for spatial queries.

  • -DSQLITE_ENABLE_MATH_FUNCTIONS

    Enables built-in SQL math functions (sin, cos, log, sqrt, etc.).

  • -DSQLITE_ENABLE_JSON1

    Enables JSON functions for managing JSON data in SQL.

  • -DSQLITE_ENABLE_DBSTAT_VTAB

    Enables the dbstat virtual table to query database space usage.

  • -pthread

    Adds support for multithreading with the pthreads library.

How to Create Resource

Download

mkdir -p .tmp
# Download SQLite 3.49.1 Amalgamation (Released in early 2025)
curl -L https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip -o .tmp/sqlite-amalgamation-3490100.zip
unzip .tmp/sqlite-amalgamation-3490100.zip -d .tmp/

Extracting Source Files

# Copy the amalgamation source file
cp .tmp/sqlite-amalgamation-3490100/sqlite3.c lib/SPVM/Resource/SQLite.native/src/

Extracting Header Files

# Copy the header files
cp .tmp/sqlite-amalgamation-3490100/sqlite3.h lib/SPVM/Resource/SQLite.native/include/
cp .tmp/sqlite-amalgamation-3490100/sqlite3ext.h lib/SPVM/Resource/SQLite.native/include/

Repository

SPVM::Resource::SQLite - Github

Author

Yuki Kimoto kimoto.yuki@gmail.com

Copyright & License

Copyright (c) 2026 Yuki Kimoto

MIT License