Skip to content

Conversation

@ssreerama
Copy link
Contributor

@ssreerama ssreerama commented Jan 26, 2026

Pull Request Template – vscode-mssql

Description

This Pr adds:

  • Table values functions template expansion for 'Add items...'
  • Scenarios:
    • When the user creates a Table‑Valued Function, check whether the Functions folder exists in the project.
    • Determine the schema in which the user is creating the function.
    • If no schema is specified, default the schema to dbo.
    • If the Functions folder exists, place the new function file under the corresponding schema folder.
    • If the Functions folder does not exist, create the function file at the schema folder/project root level.
  • Added tests to validate the scenarios
  • Added test to validate the template loading

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Tab_val_function_1

@github-actions
Copy link

github-actions bot commented Jan 26, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 5434 KB 5412 KB ⚪ -22 KB ( 0% )
sql-database-projects VSIX 5675 KB 5679 KB ⚪ 4 KB ( 0% )
data-workspace VSIX null KB 543 KB ⚪ 543 KB ( 0% )

@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.87%. Comparing base (69afcf4) to head (39ae63a).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21008      +/-   ##
==========================================
- Coverage   66.87%   66.87%   -0.01%     
==========================================
  Files         219      219              
  Lines       21014    21014              
  Branches     2758     2758              
==========================================
- Hits        14054    14053       -1     
  Misses       6857     6857              
- Partials      103      104       +1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ssreerama ssreerama self-assigned this Jan 26, 2026
@ssreerama ssreerama changed the base branch from main to sai/feb/ItemTemp1 January 26, 2026 21:02
@ssreerama ssreerama marked this pull request as ready for review January 26, 2026 21:06
@@ -0,0 +1,16 @@
CREATE FUNCTION [@@SCHEMA_NAME@@].[@@OBJECT_NAME@@]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, but why do we need a template?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template files allow us to add consistent, predefined SQL object stubs and update or expand templates over time without code changes, while keeping object placement and rules in code.

lewis-sanchez
lewis-sanchez previously approved these changes Jan 26, 2026
Base automatically changed from sai/feb/ItemTemp1 to main January 27, 2026 15:52
@ssreerama ssreerama dismissed lewis-sanchez’s stale review January 27, 2026 15:52

The base branch was changed.

// Test edge case: leading dot
result = projController.parseSchemaAndObjectName('.MyFunction');
expect(result.schemaName, 'Leading dot should not be treated as schema').to.equal('dbo');
expect(result.objectName, 'Full string should be the object name').to.equal('.MyFunction');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dot becomes part of the object name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we do allow special characters in the name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants