بنقرة واحدة
add-sql-function
How to implement a new SQL feature in squirreling.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
How to implement a new SQL feature in squirreling.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف 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.