en un clic
add-sql-function
How to implement a new SQL feature in squirreling.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
How to implement a new SQL feature in squirreling.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
| name | add-sql-function |
| description | How to implement a new SQL feature in squirreling. |
FUNCTION_SIGNATURES in src/validation/functions.jsREQUIRED for all functions.
Create tests in the appropriate test file. Include tests for:
Run the test to confirm it fails:
npx vitest test/execute/execute.math.test.js --run
In src/validation/functions.js, add the function name to the appropriate type guard array (isMathFunc, isStringFunc, isAggregateFunc, or isRegexpFunc).
In src/validation/functions.js, add to FUNCTION_SIGNATURES:
NEW_FUNCTION: { min: 1, max: 1, signature: 'value' },
// or: { min: 2, max: 2, signature: 'a, b' },
// or: { min: 1, max: 3, signature: 'required[, opt1[, opt2]]' },
// or: { min: 1, signature: 'value1[, ...]' },
REQUIRED for all functions.
Add implementation to the file determined in Step 1. Follow the pattern of existing functions in that file. Key points:
filteredRows inside the isAggregateFunc blockREQUIRED for all functions.
All three must pass:
npm test # All tests must pass
npm run lint # No linting errors
npx tsc # TypeScript must pass
REQUIRED for: New built-in functions that users should know about. SKIP for: Internal helper functions or variations of existing functions.
Add the function to the appropriate list in the "Functions" section of README.md.