advpl-embedded-sql

Community

Write safe Protheus SQL without token waste.

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/EndSql with 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 into BeginSql/EndSql (and keep MPSysOpenQuery when you need automatic TCSetField via 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 required

Components

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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.