LLM Reference
easymysql.com/llms.txt is the whole 0.2 API in one
Markdown file: the rules, an API map, every operation with its signature, the error table,
and the differences between the backends. It is written for a coding assistant's context
window, not for reading top to bottom.
curl -O https://www.easymysql.com/llms.txt easymysql.com/llm.md redirects to the same file. It also ships in the
repository as llm.md.
What is in it
| Section | Contents |
|---|---|
| 1. Rules | Five things to always do, and thirteen patterns not to generate, each with the wrong and right form |
| 2. API map | Every public method, what it returns, and the section that covers it |
| 3–4. Import, connect, lifecycle | Both backends, driver options, threads, and the reconnection contract |
| 5–7. Reading, writing, raw SQL | Signatures and behaviour for select, upsert, bulk writes, expressions and batches |
| 8. Transactions and session state | Savepoints, thread ownership, the pending-work guard, resetSession() |
| 9–11. Conditions, clauses, builders | Every constructor, the keyword clauses, and the (sql, params) functions |
| 12–14. Types, errors, backends | Type mapping, the full exception table, and the MySQL/PostgreSQL differences |
| 15. Worked example | Five functions covering the common operations |
Using it
Paste it into the assistant's context, or drop it in the project so the assistant reads it with the rest of the repository.
| Tool | Where it goes |
|---|---|
| Claude Code | llm.md at the project root, referenced from CLAUDE.md |
| Cursor | .cursor/rules/easymysql.md |
| GitHub Copilot | .github/copilot-instructions.md |
| Chat interfaces | Attach the file, or paste it before the question |
A one-line pointer is enough when the file is already in the project:
Use easymysql 0.2. The API is described in llm.md; follow section 1 exactly. Scope
The file describes 0.2.0.0. Every example in it is executed against MySQL 8.0.46 and PostgreSQL 16.14 as part of the release check, on Python 3.9 to 3.14.
/docs/v1 describes 0.1.9 and its examples do not run on 0.2. An
assistant that was trained on it, or that finds it first, will generate calls that
raise — update() and delete() without a condition,
resetCache(), and conditions built by string concatenation. The file states
this in its header.
What it changes in generated code
The behaviours that a model trained on older wrappers gets wrong, and that section 1 of the file states first:
- Conditions are dictionaries or
Conditionobjects — never concatenated strings. - Failures are exceptions; no return value signals them.
- A transaction belongs to the thread that opened it.
- Nothing is retried or reconnected automatically.
- A CRUD call after a raw
execute()raises until the pending work is committed or rolled back. and,orandnotover aConditionraiseTypeError.