bknd-define-relationship

Define entity relationships in BKnd schemas with mappedBy, inversedBy, and connectionTable.

1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/cameronapak/melos --skill bknd-define-relationship
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bknd-define-relationship
Source: https://github.com/cameronapak/melos/tree/main/.agents/skills/bknd-define-relationship
Command: npx skills add https://github.com/cameronapak/melos --skill bknd-define-relationship

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defining and maintaining clear relationships between BKnd entities can be complex when dealing with many-to-one, one-to-one, many-to-many, and self-referencing patterns. This Skill provides structured guidance to model relationships, configure fields, and align data navigation for intuitive access.

Core Features & Use Cases

  • UI & Code Approaches: Learn how to set up relationships via BKnd's Data UI and through code using the em() schema builder.
  • Relationship Types: Implement many-to-one, one-to-one, many-to-many, and self-referencing relations with proper join/junction logic.
  • Options & Mappings: Use mappedBy, inversedBy, and connectionTable to customize FK naming and navigation.

Quick Start

Create a schema with entities like users and posts, then define a many-to-one relation from posts to users and a many-to-many relation between posts and tags using em() and relation() calls.

Frequently Asked Questions about bknd-define-relationship

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

FAQPage Schema
How do I define many-to-many relationships in a BKnd schema?

To define many-to-many relationships in a BKnd schema, use the em() builder and relation() calls with the connectionTable option to configure join logic and junction tables.

Can I configure entity relationships using the BKnd Data UI instead of code?

Yes, you can configure entity relationships directly through the BKnd Data UI or programmatically via code using the em() schema builder for identical relationship modeling capabilities.

What is the best way to set up self-referencing relations in BKnd?

The best way to set up self-referencing relations in BKnd is by using the em() schema builder to configure the relation() call, ensuring proper join logic for entities referencing themselves.

How do mappedBy and inversedBy work when customizing foreign keys in BKnd?

The mappedBy and inversedBy options in BKnd customize foreign key naming and enable inverse navigation, allowing precise control over how entities link back to each other across relationship patterns.

Does BKnd support one-to-one entity mappings with custom join logic?

Yes, BKnd supports one-to-one entity mappings by utilizing the relation() function alongside options like mappedBy and inversedBy to establish custom join logic and accurate inverse navigation.