understanding-db-schema

Answer questions about Logseq's Datascript database schema and relationships.

3|2|Updated Nov 11, 2025
One-click install
npx skills add https://github.com/C0ntr0lledCha0s/claude-code-plugin-automations --skill understanding-db-schema
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: understanding-db-schema
Source: https://github.com/C0ntr0lledCha0s/claude-code-plugin-automations/tree/main/logseq-expert/skills/understanding-db-schema
Command: npx skills add https://github.com/C0ntr0lledCha0s/claude-code-plugin-automations --skill understanding-db-schema

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Deep expertise in Logseq's Datascript DB schema, including attributes, classes, property types, and schema validation.

Core Features & Use Cases

  • Core attribute types and cardinalities
  • Built-in classes and their relationships
  • Property types and namespaces
  • Malli-based validation and node-model overview

Quick Start

Inspect the DB schema samples and validate a simple class definition.

Frequently Asked Questions about understanding-db-schema

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

FAQPage Schema
How do I understand Logseq's Datascript database schema and entity relationships?

Logseq's Datascript schema uses an Entity-Attribute-Value (EAV) model to store pages, blocks, and properties with defined cardinalities and types. The schema defines built-in classes, attributes, and validation rules that govern how graph data is structured and related across nodes.

What are the core attribute types and cardinalities in Logseq's node-model?

Logseq's schema includes attributes with scalar and reference cardinalities, supporting one-to-one and one-to-many relationships. Built-in attributes define page identity, block content, property namespaces, and entity types through Malli-based validation rules.

Can I validate custom class definitions against Logseq's Datascript schema?

Yes. Logseq uses Malli for schema validation, allowing you to define and validate custom classes against the built-in attribute types, cardinalities, and property constraints within the Datascript graph model.

How do page, block, and property relationships work in Logseq's database?

Pages and blocks are entities with distinct attributes and cardinalities; properties attach metadata through namespaced attributes. The schema defines their relationships and enforces structural constraints through EAV attributes and automatic entity linking.

What do I need to know about Logseq's schema versioning and attribute design?

Understanding schema versioning helps you track changes to Datascript attributes and classes. Attribute design in Logseq follows EAV patterns with explicit cardinality and type definitions to maintain consistency across the graph as it evolves.