skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
thalysjuvenal/advpl-specialist51 installs

query-builder

Use when the user needs to build, choose the pattern for, or optimize a SQL query against Protheus ERP tables -- covering Workarea (DbSelectArea/DbSeek) vs Embedded SQL vs TCSqlExec pattern choice, mandatory D_E_L_E_T_/xFilial filters, SIX index-aligned WHERE ordering, FWPreparedStatement parameterization to prevent SQL injection, and cross-database (PostgreSQL/MSSQL/Oracle) portability. Also triggers on Portuguese phrasing like "consulta SQL", "montar query", "otimizar consulta", "qual indice usar", "escolher entre DbSeek ou SQL", or "prevenir SQL injection no Protheus".

How do I install this agent skill?

npx skills add https://github.com/thalysjuvenal/advpl-specialist --skill query-builder
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides comprehensive documentation and code templates for building secure, optimized, and cross-database compatible SQL queries for the Protheus ERP environment (AdvPL). It emphasizes security best practices, specifically the use of parameterized queries to prevent SQL injection. No malicious patterns or security risks were detected.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

Protheus Query Builder

This skill helps build correct, safe, and optimized SQL against Protheus ERP tables, respecting the platform's database conventions: mandatory soft-delete (D_E_L_E_T_) and multi-branch (xFilial) filters, Hungarian-notation field names, dictionary-driven physical schemas (RetSqlName()), and SIX index alignment. It guides the agent to choose the right access pattern -- Workarea navigation vs Embedded SQL vs raw TCSqlExec -- enforce mandatory filters, order WHERE clauses to match available indexes, and parameterize every dynamic value with FWPreparedStatement to eliminate injection risk.

Activate this skill when building any query against Protheus tables (standard SA*/SE*/SF* or custom Z*), deciding between DbSelectArea/DbSeek and Embedded SQL, reviewing code for missing mandatory filters, adding parameterized queries, diagnosing slow queries via index misalignment, or writing cross-database code. It does not cover BeginSQL/EndSQL macro syntax itself (see embedded-sql, its companion skill for macro details), nor record locking semantics during writes (see protheus-locks-deadlocks).

Reference fileRead when
reference.mdAlways -- database conventions, table/field naming, mandatory filters, pattern-choice overview
patterns-workarea.mdGenerating record-by-record code with DbSelectArea + DbSeek + RecLock
patterns-fwpreparedstatement.mdBuilding parameterized TCQuery/TCSqlExec, LIKE clauses, INSERT/UPDATE/DELETE
index-awareness.mdChoosing/validating an index, ordering WHERE clauses, common SIX key expressions
cross-database.mdUsing ChangeQuery(), TCGetDB(), DBAccess macros, MSSQL/PostgreSQL/Oracle equivalents

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/thalysjuvenal/advpl-specialist/query-builder">View query-builder on skillZs</a>