fantasia-sqlite-main

Configure per-user SQLite storage and migrations in Electron main process.

401|56|Updated Jan 30, 2021
One-click install
npx skills add https://github.com/vishiri/fantasia-archive --skill fantasia-sqlite-main
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fantasia-sqlite-main
Source: https://github.com/vishiri/fantasia-archive/tree/main/.cursor/skills/fantasia-sqlite-main
Command: npx skills add https://github.com/vishiri/fantasia-archive --skill fantasia-sqlite-main

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing SQLite persistence in Fantasia Archive's Electron main process requires careful per-user data isolation, safe path handling, and migration planning to prevent data loss or corruption at upgrade time.

Core Features & Use Cases

  • Define per-user storage location using app.getPath('userData') and ensure directories exist before opening the DB.
  • Keep sqlite3 as a native dependency in the main process, avoiding renderer-initiated SQL to prevent untrusted access.
  • Plan and implement migrations with versioned schemas and safe upgrade paths for user data continuity.
  • Use Case: When upgrading Fantasia Archive to a new schema version, apply migrations automatically on startup.

Quick Start

Configure per-user SQLite storage in the Electron main process and plan migrations.

Frequently Asked Questions about fantasia-sqlite-main

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure SQLite per-user storage paths in an Electron main process?

Configure SQLite per-user storage in the Electron main process by using app.getPath('userData') and ensuring directories exist before opening the database to isolate data safely per user.

Why should I avoid running SQLite queries in the Electron renderer process?

Avoiding SQLite queries in the Electron renderer process prevents untrusted access. Keep sqlite3 as a native dependency in the main process to enforce safe lifecycle handling and production security constraints.

What's the best way to handle SQLite database migrations during Electron app upgrades?

Handle SQLite database migrations during app upgrades by planning versioned schemas and safe upgrade paths, applying migrations automatically on startup to ensure user data continuity and prevent data loss.

Does sqlite3 work as a native dependency in Electron for local user data persistence?

Yes, sqlite3 works as a native dependency in the Electron main process for local user data persistence. Enforce native sqlite3 constraints and safe lifecycle handling in production to prevent database corruption.

What are the limitations of using native sqlite3 for Electron desktop app persistence?

Limitations of using native sqlite3 for Electron persistence include strict main process isolation requirements, careful per-user path handling, and the need for versioned migration planning to avoid data corruption during upgrades.