openaec-foundation/frappe_claude_skill_package/frappe-syntax-query-builder
Claude Code and agent skill by openaec-foundation/frappe_claude_skill_package
- community
Checking that the SKILL.md file is still in the repository.
Use when building database queries with frappe.qb in Frappe v14-v16. Covers the PyPika-based query builder: SELECT, INSERT, UPDATE, DELETE, joins, aggregation, subqueries, cross-DB compatibility (MariaDB/PostgreSQL), and migration from raw SQL. Prevents SQL injection and DB-specific bugs. Keywords: frappe.qb, query builder, DocType, Field, pypika, join,, frappe.qb example, how to write query, join tables, SQL replacement, parameterized query. aggregate, ImportMapper, cross-database, parameterized query.
Install
npx vskill@latest install openaec-foundation/frappe_claude_skill_package/frappe-syntax-query-builderSKILL.md
The same SKILL.md was published earlier as openaec-foundation/frappe_claude_skill_package/frappe-syntax-query-builder.
Frappe Query Builder (frappe.qb)
Quick Reference
| Action | Pattern | |
|---|---|---|
| SELECT | frappe.qb.from_("DocType").select("field1", "field2") | |
| WHERE | .where(Field("status") == "Open") | |
| ORDER | .orderby("creation", order=Order.desc) | |
| LIMIT | .limit(10).offset(0) | |
| JOIN | .left_join(dt2).on(dt2.name == dt1.parent) | |
| COUNT | .select(Count("*")) | |
| INSERT | frappe.qb.into("DocType").columns("f1", "f2").insert("v1", "v2") | |
| UPDATE | frappe.qb.update("DocType").set("field", "value").where(...) | |
| DELETE | frappe.qb.from_("DocType").delete().where(...) | |
| RUN | .run() (tuples) / .run(as_dict=True) (dicts) |
Decision Tree
Core Patterns
SELECT with DocType
JOIN
Aggregation
INSERT / UPDATE / DELETE
Filtering
Cross-DB Compatibility
| MariaDB | PostgreSQL | Use ImportMapper | |
|---|---|---|---|
GROUP_CONCAT | STRING_AGG | Yes | |
MATCH...AGAINST | TO_TSVECTOR | Yes | |
Locate | Strpos | Yes | |
Timestamp | Extract-based | Auto-handled |
Anti-patterns
- NEVER pass qb query to `frappe.db.sql()` — bypasses parameterization
- NEVER use `Table()` for DocTypes — use
DocType()(addstabprefix) - NEVER forget `.run()` — without it you get a query object, not results
- NEVER use raw SQL strings in `frappe.get_all(fields=[...])` — use dict syntax
- ALWAYS use `ImportMapper` for DB-specific functions
- ALWAYS chain `.run(as_dict=True)` when you need dicts — default is tuples
Version Differences
| Feature | v14 | v15 | v16 | |
|---|---|---|---|---|
| Core qb API | Introduced | Yes | Yes | |
| ImportMapper | Yes | Yes | Yes | |
| SQLite backend | -- | -- | Added | |
| Masked fields | -- | -- | Added | |
| Union queries (.walk) | -- | Added | Yes | |
| Child query execution | -- | -- | Added |
Reference Files
- Functions & Aggregates — All available qb functions
- Migration Guide — Converting raw SQL and get_all patterns
- Cross-DB Patterns — ImportMapper and DB-specific functions
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/source/syntax/frappe-syntax-query-builder/SKILL.md
Popularity
- Repository stars
- 88
- Repository forks
- 25
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 29 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openaec-foundation/frappe_claude_skill_package/frappe-syntax-query-builder)