Skip to content

Rename SQLRaw to SQLUnsafeRaw and SQLRawBuilder to SQLUnsafeRawBuilder#189

Closed
gwynne wants to merge 5 commits intomainfrom
rename-sqlraw-sqlunsaferaw
Closed

Rename SQLRaw to SQLUnsafeRaw and SQLRawBuilder to SQLUnsafeRawBuilder#189
gwynne wants to merge 5 commits intomainfrom
rename-sqlraw-sqlunsaferaw

Conversation

@gwynne
Copy link
Member

@gwynne gwynne commented Apr 16, 2025

We really want to emphasize as much as possible that using raw SQL is unsafe. These changes also match up with the same renames in the Fluent 5 version of SQLKit. The original SQLRaw and SQLRawBuilder names are preserved as a deprecated typealias, as is the original SQLDatabase.raw(_:) spelling of what is now the SQLDatabase.unsafeRaw(_:) method.

@gwynne gwynne added the semver-minor Contains new APIs label Apr 16, 2025
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy April 16, 2025 22:58
@codecov
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (baf0d86) to head (ca73531).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #189   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          100       100           
  Lines         2662      2664    +2     
=========================================
+ Hits          2662      2664    +2     
Files with missing lines Coverage Δ
...QLKit/Builders/Implementations/SQLRawBuilder.swift 100.00% <100.00%> (ø)
...es/SQLKit/Builders/Prototypes/SQLJoinBuilder.swift 100.00% <100.00%> (ø)
Sources/SQLKit/Database/SQLDialect.swift 100.00% <100.00%> (ø)
...ces/SQLKit/Deprecated/SQLDatabase+Deprecated.swift 100.00% <100.00%> (ø)
.../SQLKit/Deprecated/SQLExpressions+Deprecated.swift 100.00% <ø> (ø)
...QLKit/Deprecated/SQLQueryBuilders+Deprecated.swift 100.00% <100.00%> (ø)
...ources/SQLKit/Expressions/Basics/SQLDataType.swift 100.00% <100.00%> (ø)
...ces/SQLKit/Expressions/Basics/SQLQueryString.swift 100.00% <100.00%> (ø)
...LKit/Expressions/Clauses/SQLColumnDefinition.swift 100.00% <100.00%> (ø)
...ces/SQLKit/Expressions/Clauses/SQLJoinMethod.swift 100.00% <ø> (ø)
... and 9 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

I have to say, something about this does feel off - essential all the unsafe usages inside our codebase. I know it's a semantic thing and I don't really have a good answer other than adding internal functions for our own use. But I don't think it's an issue or a blocker, just something I noticed. (Also came up when thinking about other libraries such as FluentPostGIS - I guess we need to be able to opt into the unsafe things so this is probably the best way)

@gwynne gwynne closed this Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minor Contains new APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants