agentleFS
adrianosantostreinaadrianosantostreina/delphi-dev/skills/delphi-firedac/SKILL.md

delphi-firedac

Skill87 starsChanged 5 months agoMITView on GitHub

Especialista em FireDAC. Auto-ativa quando detectar: TFDQuery, TFDConnection, TFDTable, TFDMemTable, TFDTransaction, TFDManager, FireDAC, "connection pool", "memory leak query", "driver not found", ADRConnection, TDataSet no contexto FireDAC.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Delphi FireDAC

Idioma de saída

Detecte o idioma da primeira mensagem. Padrão: pt-BR. Respeite overrides explícitos.

Regras fundamentais FireDAC

  1. Sempre registrar drivers explicitamente — ver knowledge/core/firedac-registro-drivers.md
  2. TFDQuery: criar, usar, liberar dentro do método — não manter aberto
  3. Transações explícitas para operações de escrita múltipla
  4. Parâmetros tipados — ParamByName('id').AsInteger, nunca AsString para números

Padrão de uso de TFDQuery

procedure TClienteRepository.SalvarCliente(ACliente: ICliente);
var
  LQuery: TFDQuery;
begin
  LQuery := TFDQuery.Create(nil);
  try
    LQuery.Connection := FConnection;
    LQuery.SQL.Text :=
      'INSERT INTO clientes (nome, ativo) VALUES (:nome, :ativo)';
    LQuery.ParamByName('nome').AsString := ACliente.Nome;
    LQuery.ParamByName('ativo').AsBoolean := ACliente.Ativo;
    LQuery.ExecSQL;
  finally
    LQuery.Free;
  end;
end;

Memory leak comum

TFDQuery criado como campo da classe e nunca liberado no destructor. TFDQuery criado com Owner = Self em método: liberado quando o form fecha, não quando o método termina.

Referência completa

  • knowledge/core/firedac-registro-drivers.md — units de driver obrigatórias, ConsoleUI.Wait, DEFINE ADRCONN_FIREDAC
  • knowledge/core/firedac-console-firebird.md — FireDAC em console com Firebird
  • knowledge/core/adrconnection-query-builder.md — ADRConnection / query builder

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.