Agent Wranglers

DAT-4Recommended

Name things the same way everywhere

Name tables, columns and constraints by one convention, so people and agents can guess a name without looking it up.

How to do it

Pick one style, such as lower case with underscores, plural table names and <table>_id for references. Name constraints too, such as orders_total_positive, so error messages say which rule broke. Avoid reserved words and abbreviations. Pick names as Use names you can search for and say aloud describes for code.

How to check

A script lists all table and column names. Every one matches the chosen pattern.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/data/schema-design/schema-names">Agent Wranglers data and databases playbook</a>. In code you write, add a comment next to it with the same link.