generating-recordsql

Generate and validate Divalto DIVA RecordSql .dhsq files from Jinja2 templates and naming tokens.

6|Updated May 11, 2026
One-click install
npx skills add https://github.com/divalto/divalto-ia-devkit --skill generating-recordsql-divalto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generating-recordsql
Source: https://github.com/divalto/divalto-ia-devkit/tree/main/plugins/divalto-devkit/skills/generating-recordsql
Command: npx skills add https://github.com/divalto/divalto-ia-devkit --skill generating-recordsql-divalto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jinja2, and includes scripts (resource) and references (resource) components.

What problem does it solve? Writing a RecordSql (.dhsq) file for a DIVA business entity by hand is error-prone: the mandatory multi-folder filter (Dos = MZ.Dos), the OverWrittenBy declaration, the ISO-8859-1 + CRLF encoding, and consistent naming tokens are easy to get wrong, causing compilation failures or security issues. ## Core Features & Use Cases - Deterministic generation: Renders a complete .dhsq file from a Jinja2 template using naming tokens computed from domain, entity, table, and key field parameters, written in ISO-8859-1 with CRLF line endings. - Multi-table joins and skeletons: Supports implicit joins, LEFT JOINs, additional WHERE cases via JSON tokens, a --fk flag for foreign-key lookups, and 8 pre-configured skeleton files reproducing the most common ERP join super-patterns. - Rule-based validation: The validate_rsql.py script checks 8 rules (R01-R08) covering the multi-folder filter, OverWrittenBy, SELECT/FROM sections, dictionary coherence, encoding, and join syntax. - Use Case: Ask to generate the RecordSql for the Retail entity FamRglt (table RtlFamRglt, key RgltFam) and receive a validated .dhsq file with standard WHERE/ORDERBY cases and zero validation errors. ## Quick Start Generate the RecordSql file for the entity FamRglt in the Retail domain with table RtlFamRglt, key field RgltFam, and description 'Famille de reglement', then validate it.

Frequently Asked Questions about generating-recordsql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a RecordSql .dhsq file for a DIVA entity?

Run generate_rsql.py with --params, passing the domain, entity, SQL table, key field, description, and output path. The script computes naming tokens, renders the Jinja2 template, and writes the file in ISO-8859-1 with CRLF line endings.

How do I add joins to a generated RecordSql file?

Pass joined_tables entries in the JSON tokens with join_type implicit or left_join, a join condition, and selected columns. Alternatively use the repeatable --fk CHAMP:TARGET flag to generate a LEFT JOIN with a Lib column, or --skeleton to load a pre-configured join pattern.

What validation rules does validate_rsql.py check?

It checks eight rules: R01 multi-folder filter Dos = MZ.Dos, R02 OverWrittenBy presence, R03 RecordSql name coherence, R04 SELECT and FROM sections, R05 DefaultDictionary, R06 ISO-8859-1 plus CRLF encoding, R07 implicit join coherence, and R08 LEFT JOIN syntax.

Why does my RecordSql compilation fail with Error 30 on a Case parameter?

Error 30 occurs when a Case parameter uses the type long, which is not valid in a Where condition. Replace it with int; the case of type keywords is free, so CHAR, INT, or DATE capitalized also compile.

Can I overload a standard RecordSql without copying the whole file?

Yes, an overload .dhsq is an append-only delta containing only new SELECT fields, joins, or ORDERBY criteria. Repeating standard sections like FROM, WHERE, or Public Record declarations causes double-definition compilation errors.