S
Supanote
Sign in Sign up
Database, Cache & Warehouse

Database & SQL Configuration Templates

Production blueprints for PostgreSQL 18 io_uring & UUIDv7, MySQL 8.4 LTS, MariaDB 11.8 Vector Index, SQLite 3.50, MongoDB 8.0, Redis 8.0, Memcached 1.6, and BigQuery FinOps.

sql
Verified Starter

High-Performance SQLite Production PRAGMAs

Maximum performance SQLite pragmas for WAL mode, concurrency, and memory buffers.

-- High-Performance Concurrent SQLite Configuration
-- Run immediately after opening database connection

-- 1. Enable Write-Ahead Logging (concurrent readers + writer)
PRAGMA journal_mode = WAL;

-- 2. Synchronous NORMAL is safe in WAL mode and...
sql
Verified Starter

SQLite FTS5 Full-Text Search Schema & Sync Triggers

External content FTS5 virtual table with unicode61 tokenizer and insert, update, and delete synchronization triggers.

-- High-Performance SQLite FTS5 External Content Virtual Table
-- Synchronizes search index with the primary 'articles' table

-- 1. Create FTS5 Virtual Table
CREATE VIRTUAL TABLE IF NOT EXISTS articles_fts USING fts5(
  title,
  body,
 ...
bash SQLite 3.50+
Verified Starter

SQLite 3.50+ Live Remote Replication Script (sqlite3_rsync)

Automate bandwidth-efficient live SQLite 3.50+ backups over SSH using official sqlite3_rsync page-level delta transfers and quick_check.

#!/usr/bin/env bash
# Live Bandwidth-Optimized SQLite 3.50+ Remote Replication via sqlite3_rsync
# Schedule every 1-5 minutes via systemd timer or cron:
# */2 * * * * /usr/local/bin/sqlite-rsync-replica.sh >> /var/log/sqlite-rsync.log 2>&1

set -euo...
sql SQLite 3.50+
Verified Starter

SQLite 3.50+ Binary JSONB, STRICT Table & Generated Indexes

Cut SQLite JSON CPU overhead by 50%+ using binary JSONB BLOB storage, STRICT tables, VIRTUAL generated columns, and jsonb_set updates.

-- SQLite 3.45 - 3.50+ High-Speed Binary JSONB + STRICT Table + Generated Index Pattern
-- Binary JSONB avoids repeated text parsing and enables localized in-place mutations in 3.50+

PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;

-- 1....
Notification