bel-crm-sql-rules

Enforce compliant SQL patterns for bel-crm PostgreSQL MCP server operations.

2|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/bennoloeffler/bassi --skill bel-crm-sql-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bel-crm-sql-rules
Source: https://github.com/bennoloeffler/bassi/tree/main/.claude/skills/bel-crm-sql-rules
Command: npx skills add https://github.com/bennoloeffler/bassi --skill bel-crm-sql-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces SQL errors by documenting PostgreSQL MCP server limitations and correct CRM-oriented patterns.

Core Features & Use Cases

  • Forbidden patterns: RETURNING, ON CONFLICT, and multi-statement patterns that fail.
  • Correct patterns: two-step insert+read for IDs, safe updates/deletes.
  • Tool Guidance: consult this ruleset before writing SQL for CRM tasks.

Quick Start

Always review bel-crm-sql-rules prior to crafting SQL for bel-crm-db.

Frequently Asked Questions about bel-crm-sql-rules

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

FAQPage Schema
How do I write SQL queries for the bel-crm PostgreSQL MCP server?

SQL queries for bel-crm must follow strict patterns: use separate read_query and write_query calls, forbid RETURNING and ON CONFLICT clauses, avoid multi-statement queries, and retrieve inserted IDs through a two-step insert-then-read workflow instead of relying on transaction commands.

What SQL patterns don't work with bel-crm-db?

RETURNING clauses, ON CONFLICT logic, multiple statements in a single call, and transaction commands (BEGIN, COMMIT, ROLLBACK) are unsupported. These limitations require restructuring insert, update, and delete operations into separate compliant read and write operations.

How do I retrieve an ID after inserting a row into bel-crm?

Insert rows using write_query without RETURNING, then execute a separate read_query to fetch the inserted ID by querying the table with appropriate WHERE conditions. This two-step pattern works around the absence of RETURNING support.

Can I use ON CONFLICT or upsert patterns with bel-crm SQL?

No, ON CONFLICT is forbidden in bel-crm. Instead, use a check-then-insert workflow: read_query to detect existing rows, then conditionally execute write_query for insert or update operations based on the result.

Do I need to know bel-crm SQL limits before querying the CRM database?

Yes, reviewing bel-crm-sql-rules before writing queries prevents errors. The ruleset documents all forbidden patterns (RETURNING, ON CONFLICT, multi-statement, transactions) and prescribes correct CRM-oriented patterns for insert, update, delete, and read operations.