SIMPLE_SQL Documentation

World-Class SQLite Library for Eiffel

EiffelStudio Integration

This documentation is integrated with EiffelStudio via EIS (Eiffel Information System). Press F1 on any SIMPLE_SQL class or feature to open its documentation. Click any class link to navigate directly to the source code.

What is SIMPLE_SQL?

SIMPLE_SQL is a comprehensive SQLite library for Eiffel that provides:

Quick Example

local
    db: SIMPLE_SQL_DATABASE
    result: SIMPLE_SQL_RESULT
do
    -- Open database
    create db.make ("myapp.db")

    -- Fluent query builder
    result := db.select_from ("users")
        .columns ("id, name, email")
        .where ("active = 1")
        .order_by ("name")
        .limit (10)
        .execute

    -- Process results
    across result as row loop
        print (row.string_value ("name") + "%N")
    end

    db.close
end

Key Features

Fluent Query Builder

Build SQL queries with chainable methods. Type-safe, readable, and SQL injection-proof.

Learn more →

Eager Loading

Eliminate N+1 query problems with the .include() pattern. Load related data in batches.

Learn more →

Soft Delete Scopes

Built-in soft delete support with .active_only, .deleted_only, and .with_deleted scopes.

Learn more →

Cursor Pagination

Efficient cursor-based pagination for large datasets. No offset performance penalty.

Learn more →

Full-Text Search

SQLite FTS5 integration with BM25 ranking, boolean queries, and phrase matching.

Learn more →

N+1 Detection

Runtime monitoring for repeated query patterns. Get warnings before performance issues hit production.

Learn more →

Mock-Driven Development

SIMPLE_SQL is developed using Mock-Driven Development - building realistic consumer applications to drive API improvements. Each mock app exposes friction points that become library features.

4 Mock Applications

Real-world apps that stress-test the library and drive improvements

460+
Tests
4
Mock Apps
30+
Classes
5
Phases Complete
Mock App Domain Tests Friction Exposed API Improvement
TODO App Task Management Basic Query builder basics Fluent API patterns
CPM Scheduler Project Scheduling 51 activities Parameterized queries execute_with_args
Habit Tracker Time-Series Data 25 tests Aggregations, soft deletes Streaming cursors
Document Management Enterprise DMS 64 tests N+1, pagination, boilerplate Eager loading, pagination builder, N+1 detection

Architecture

SIMPLE_SQL_DATABASE (core)
├── SIMPLE_SQL_PREPARED_STATEMENT
├── SIMPLE_SQL_PRAGMA_CONFIG
└── SIMPLE_SQL_QUERY_MONITOR

SIMPLE_SQL_QUERY_BUILDER
├── SIMPLE_SQL_SELECT_BUILDER (with soft delete scopes)
├── SIMPLE_SQL_INSERT_BUILDER
├── SIMPLE_SQL_UPDATE_BUILDER
└── SIMPLE_SQL_DELETE_BUILDER

SIMPLE_SQL_SCHEMA
├── SIMPLE_SQL_MIGRATION
├── SIMPLE_SQL_MIGRATION_RUNNER
├── SIMPLE_SQL_TABLE_INFO
└── SIMPLE_SQL_COLUMN_INFO

SIMPLE_SQL_FTS5
└── SIMPLE_SQL_FTS5_QUERY

SIMPLE_SQL_AUDIT
SIMPLE_SQL_REPOSITORY [G]

SIMPLE_SQL_VECTOR
├── SIMPLE_SQL_VECTOR_STORE
└── SIMPLE_SQL_SIMILARITY

SIMPLE_SQL_RESULT (eager loading)
└── SIMPLE_SQL_ROW

SIMPLE_SQL_CURSOR (lazy iteration)
└── SIMPLE_SQL_CURSOR_ITERATOR

SIMPLE_SQL_RESULT_STREAM (callback streaming)

SIMPLE_SQL_BACKUP
├── SIMPLE_SQL_ONLINE_BACKUP
├── SIMPLE_SQL_EXPORT
└── SIMPLE_SQL_IMPORT

SIMPLE_SQL_EAGER_LOADER (N+1 prevention)
└── SIMPLE_SQL_EAGER_RESULT

SIMPLE_SQL_PAGINATOR (cursor-based pagination)
└── SIMPLE_SQL_PAGE

Getting Started

Ready to use SIMPLE_SQL? Check out the Quick Start Guide to begin.