generate_template
Generates BSG-compliant SQL templates for a chosen object type, adding mandatory fields, documentation headers, and constraint naming to standardize database objects.
Instructions
Generates a complete, BSG-compliant SQL template for a given object type. Includes all mandatory fields, documentation headers, and constraint naming.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Base name WITHOUT prefix (e.g., 'Alumno' → T_Alumno, SP_TAlumno_Insertar) | |
| action | No | For SP: the DML action | |
| author | Yes | Author name for documentation header | |
| fields | No | For TABLE: field definitions (audit fields are auto-appended) | |
| schema | Yes | SQL schema name (e.g., 'com', 'mkt', 'rrhh') | |
| returns | No | For SP/FUNCTION: what the object returns | |
| parameters | No | For SP/FUNCTION: parameter definitions | |
| table_name | No | For TRIGGER: the table name the trigger belongs to | |
| description | Yes | Description for documentation header | |
| object_type | Yes | Type of SQL object to generate | |
| trigger_action | No | For TRIGGER: which DML actions fire the trigger |