Skip to content

fix-more-sql-syntax-issues (closes #20453)#21326

Closed
idseefeld wants to merge 260 commits intoumbraco:mainfrom
idseefeld:v173/20453-fix-more-sql-syntax-issues
Closed

fix-more-sql-syntax-issues (closes #20453)#21326
idseefeld wants to merge 260 commits intoumbraco:mainfrom
idseefeld:v173/20453-fix-more-sql-syntax-issues

Conversation

@idseefeld
Copy link
Copy Markdown
Contributor

Prerequisites

All unit & integration test for SQLite & SQL Server should run successfully.

Changes are meaningful for my PostgreSQL provider: https://github.com/idseefeld/Umbraco-CMS/tree/v173/postgreSqlProvider

Copilot AI review requested due to automatic review settings January 7, 2026 17:44
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 7, 2026

Hi there @idseefeld, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes SQL syntax issues to support PostgreSQL provider compatibility. The changes standardize column name casing to lowercase, replace ExecuteScalar with FirstOrDefault for better database compatibility, add PostgreSQL sequence support, and refactor database insertion methods to use a centralized approach with DTO-based table/column name constants.

Key changes:

  • Standardized column naming to use lowercase and constants from DTOs
  • Added sequence support infrastructure for PostgreSQL compatibility
  • Refactored database insertion to use a centralized Insert<T> method
  • Changed ExecuteScalar calls to FirstOrDefault for consistency

Reviewed changes

Copilot reviewed 110 out of 110 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ContentTypeRepositorySqlClausesTest.cs Fixed column name casing in test assertions (Id → id, UniqueId → uniqueId)
NPocoSqlExtensionsTests.cs Updated test to expect LOWER() wrapper for case-insensitive string comparisons
DictionaryTranslationMapperTest.cs Fixed expected column name casing (UniqueId → uniqueId)
DatabaseCacheRepository.cs Refactored update logic from InsertOrUpdate to explicit Insert/Update with typed queries
UserIdKeyResolver.cs Changed ExecuteScalar to FirstOrDefault for consistency
UmbracoDatabaseFactory.cs Changed visibility to protected for extensibility
UmbracoDatabaseExtensions.cs Changed ExecuteScalar to FirstOrDefault
SqlSyntaxProviderBase.cs & ISqlSyntaxProvider.cs Added GetNullExtension, SupportsSequences, and AlterSequences methods for PostgreSQL
Multiple Repository files Standardized to use QuoteColumnName helpers and typed SQL builders
All DTO files Added PrimaryKeyName constants and updated Column attributes to use constants
DatabaseDataCreator.cs Major refactoring: centralized Insert method, removed table/column name strings
DatabaseSchemaCreator.cs Added sequence support after identity insert operations
DatabaseSchemaInitializedNotification.cs New notification class for database schema initialization
Constants-DatabaseSchema.cs Added common primary key and column name constants
Multiple API Controller files Changed from nameof() to using NodeDto column name constants

…ons' into v173/20453-21446-21448-21451-21513-21516-DatabaseDataCreator-refactor
…eator-refactor' into v173/20453-fix-more-sql-syntax-issues
…Scalar<long>(query). It is fine for PostgreSql too.
…ons' into v173/20453-21446-21448-21451-21513-21516-DatabaseDataCreator-refactor
…eator-refactor' into v173/20453-fix-more-sql-syntax-issues
…ethods' into v173/20453-21446-21448-21451-21513-more-NPocoSqlExtensions
…ons' into v173/20453-21446-21448-21451-21513-21516-DatabaseDataCreator-refactor
…eator-refactor' into v173/20453-fix-more-sql-syntax-issues
refactor new extensions into another file
…ethods' into v173/20453-21446-21448-21451-21513-more-NPocoSqlExtensions
…ons' into v173/20453-21446-21448-21451-21513-21516-DatabaseDataCreator-refactor
…eator-refactor' into v173/20453-fix-more-sql-syntax-issues
…ethods' into v173/20453-21446-21448-21451-21513-more-NPocoSqlExtensions
…ons' into v173/20453-21446-21448-21451-21513-21516-DatabaseDataCreator-refactor
…eator-refactor' into v173/20453-fix-more-sql-syntax-issues
@idseefeld idseefeld closed this Jan 30, 2026
@idseefeld idseefeld deleted the v173/20453-fix-more-sql-syntax-issues branch January 31, 2026 10:03
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.

3 participants