advpl-embedded-sql
CommunityWrite safe Protheus SQL without token waste.
Software Engineering#macros#code migration#advpl#protheus#embedded sql#performance lint#multi-filial safety
AuthorJoniPraia
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It helps you write and maintain efficient SQL inside ADVPL/TLPP sources for the Protheus database layer, preventing cross-filial mistakes and avoiding performance regressions caused by unsafe or non-portable query patterns.
Core Features & Use Cases
- Embedded SELECT with guardrailed macros: Use
BeginSql/EndSqlwith required macros like%table%,%notDel%,%xfilial%,%exp%,%Order%,%top%, and%LIMIT%to generate correct, multi-tenant-safe SQL. - Migration from legacy SELECT approaches: Refactor
TCQuery-style string SQL intoBeginSql/EndSql(and keepMPSysOpenQuerywhen you need automaticTCSetFieldvia SX3). - Performance and safety checks: Supports lint-focused expectations such as avoiding
SELECT *and enforcing%notDel%/%xfilial%to prevent data and performance issues.
Quick Start
Use advpl-embedded-sql to rewrite your legacy TCQuery into a BeginSql/EndSql block that explicitly lists columns and includes %notDel% and %xfilial%.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: advpl-embedded-sql Download link: https://github.com/JoniPraia/plugadvpl/archive/main.zip#advpl-embedded-sql Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.