원클릭으로
remen-database
Remen SQLite database — schema, migrations, CRUD operations, query patterns, and expo-sqlite usage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Remen SQLite database — schema, migrations, CRUD operations, query patterns, and expo-sqlite usage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
On-device AI processing pipeline for Remen — model lifecycle, LLM prompts, tag/title/classify generation, queue management, and react-native-executorch integration.
Remen codebase architecture — file structure conventions, module patterns, component organization, and coding standards. Must-read before making any structural changes.
react-native-executorch integration guide — model loading, API surface, lifecycle management, quantization, and device optimization for Remen.
Remen search and retrieval system — semantic search, keyword search, temporal parsing, query NLP, and result ranking.
| name | remen-database |
| description | Remen SQLite database — schema, migrations, CRUD operations, query patterns, and expo-sqlite usage. |
| version | 1.0.0 |
SQLite via expo-sqlite with a singleton pattern.
-- lib/database/database.ts (initializeDatabase)
notes (
id TEXT PRIMARY KEY, -- UUID v4
content TEXT NOT NULL, -- Note body (markdown for tasks)
html TEXT, -- Rich text HTML
title TEXT, -- AI-generated or user-set
type TEXT DEFAULT 'note', -- note|meeting|task|idea|journal|reference|voice|scan
created_at INTEGER NOT NULL, -- Unix timestamp (ms)
updated_at INTEGER NOT NULL, -- Unix timestamp (ms)
is_processed INTEGER DEFAULT 0, -- AI processing complete
ai_status TEXT DEFAULT 'unprocessed', -- unprocessed|queued|processing|organized|failed|cancelled
ai_error TEXT, -- Error message if AI failed
embedding TEXT, -- JSON serialized float array (384-dim neural or 256-dim fallback)
original_image TEXT, -- Base64 data URI for scan photos
audio_file TEXT, -- Audio file path for voice notes
is_archived INTEGER DEFAULT 0,
is_deleted INTEGER DEFAULT 0, -- Soft delete
deleted_at INTEGER, -- When moved to trash
reminder_at INTEGER, -- Reminder timestamp
notification_id TEXT, -- expo-notifications ID
is_pinned INTEGER DEFAULT 0
)
tags (
id TEXT PRIMARY KEY,
name TEXT UNIQUE NOT NULL, -- Lowercase, trimmed
is_auto INTEGER DEFAULT 1 -- 1 = AI-generated, 0 = user-created
)
note_tags (
note_id TEXT REFERENCES notes(id),
tag_id TEXT REFERENCES tags(id),
PRIMARY KEY (note_id, tag_id)
)
tasks (
id TEXT PRIMARY KEY,
note_id TEXT REFERENCES notes(id),
content TEXT NOT NULL,
is_completed INTEGER DEFAULT 0
)
idx_notes_created on (created_at DESC)idx_notes_processed on (is_processed)idx_notes_archived on (is_archived)idx_notes_deleted on (is_deleted)import { getDatabase } from "@/lib/database/database";
const db = await getDatabase(); // Always use this, never create your own connection
is_archived = 0 AND is_deleted = 0 — shown in main listis_pinned = 1 — sorted first in active notesis_archived = 1 AND is_deleted = 0is_deleted = 1 (soft delete with deleted_at timestamp)deleteNote() or emptyTrash()JSON.stringify(float[]) in the embedding TEXT column.JSON.parse(note.embedding) — always check for null.NEURAL_EMBEDDING_DIM = 384, FALLBACK_EMBEDDING_DIM = 256 in lib/consts/consts.ts.unprocessed → queued → processing → organized (success)
→ failed (error)
→ cancelled (user action)
ALTER TABLE in the migrations block of initializeDatabase().uuid package).Date.now() (milliseconds).rowToNote().updateNote() always sets updated_at = Date.now().lib/database/database.types.ts.database.ts.