Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/madebyaris/poinf-of-salesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/madebyaris/poinf-of-sales/database-patterns)<a href="https://agentmods.dev/rules/madebyaris/poinf-of-sales/database-patterns"><img src="https://agentmods.dev/badge/rules/madebyaris/poinf-of-sales/database-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/madebyaris/poinf-of-sales/database-patterns"><img src="https://agentmods.dev/badge/rules/madebyaris/poinf-of-sales/database-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01480 |
| Opus 5 | $0.00000 | $0.00740 |
| Sonnet 5 | $0.00000 | $0.00296 |
| Haiku 4.5 | $0.00000 | $0.00148 |
Grade A, and why
database-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 229 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Development Guidelines (PostgreSQL)
Schema Design
Primary Schema
The main database schema is defined in database/init/01_schema.sql:
Core Tables Structure:
- users - Staff and user management with role-based access
- categories - Product categorization with sorting and colors
- products - Menu items with pricing and availability
- dining_tables - Table and seating management
- orders - Order lifecycle with status tracking
- order_items - Individual items within orders
- payments - Payment processing and history
- inventory - Stock management and tracking
- order_status_history - Audit trail for order changes
Naming Conventions
Table Names
- Use plural snake_case:
order_items,dining_tables - Descriptive names that clearly indicate content
- Avoid abbreviations unless universally understood
Column Names
- Use snake_case:
created_at,order_number - Boolean fields start with
is_:is_active,is_occupied - Timestamps end with
_at:created_at,processed_at - Foreign keys follow pattern:
{table_name}_id
Constraint Names
- Primary keys:
{table}_pkey - Foreign keys:
fk_{table}_{referenced_table} - Unique constraints:
unique_{table}_{column} - Check constraints:
check_{table}_{column}_{description}
Data Types & Standards
UUID Primary Keys
Use UUID v4 for all primary keys:
CREATE TABLE example_table (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
-- other columns
);
Timestamps
Always use TIMESTAMP WITH TIME ZONE for time tracking:
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
Money Values
Use DECIMAL(10,2) for all monetary values:
price DECIMAL(10,2) NOT NULL,
total_amount DECIMAL(10,2) NOT NULL DEFAULT 0
String Fields
- Use appropriate VARCHAR lengths based on expected content
- Use TEXT for long content without length restrictions
- Apply NOT NULL constraints where appropriate
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 229 lines · 1,480 tokens per session scan A 35a60e1c8ed0
database-patterns is a cursor rule published in the GitHub repository madebyaris/poinf-of-sales (140 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,480 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
adapter-features
Database-specific features must be implemented in the specialized adapter only. Base adapters (postgres, mysql, etc.) must remain database-agnostic.
unit-tests-tdd
TDD required for behavior changes; ≥80% package coverage on touched packages; unit-test conventions.
integration-tests
Human-readable integration test requests; helpers vs httptest; suites/ vs per-DB placement.
postgresql
PostgreSQL production rules. Safe migrations, parameterized queries, TIMESTAMPTZ, proper indexing strategy.
postgresql
This guide defines the definitive best practices for writing clean, performant, and maintainable PostgreSQL SQL, focusing on modern conventions and avoiding common pitfalls.
database-access
A database access pattern that separates browser reads from server-side reads and writes when using Supabase. Supabase is a hosted PostgreSQL service with rules that can restrict which users may access rows.