|
14 | 14 | namespace Lightweight |
15 | 15 | { |
16 | 16 |
|
17 | | -enum class SqlQueryBuilderMode : uint8_t |
18 | | -{ |
19 | | - Fluent, |
20 | | - Varying |
21 | | -}; |
22 | | - |
23 | 17 | struct [[nodiscard]] SqlFieldExpression final |
24 | 18 | { |
25 | 19 | std::string expression; |
@@ -112,13 +106,6 @@ class [[nodiscard]] SqlSelectQueryBuilder: public SqlBasicSelectQueryBuilder<Sql |
112 | 106 | _query.fields.reserve(256); |
113 | 107 | } |
114 | 108 |
|
115 | | - /// Sets the builder mode to Varying, allowing varying final query types. |
116 | | - constexpr LIGHTWEIGHT_FORCE_INLINE SqlSelectQueryBuilder& Varying() noexcept |
117 | | - { |
118 | | - _mode = SqlQueryBuilderMode::Varying; |
119 | | - return *this; |
120 | | - } |
121 | | - |
122 | 109 | /// Adds a sequence of columns to the SELECT clause. |
123 | 110 | template <typename... MoreFields> |
124 | 111 | SqlSelectQueryBuilder& Fields(std::string_view const& firstField, MoreFields&&... moreFields); |
@@ -256,7 +243,6 @@ class [[nodiscard]] SqlSelectQueryBuilder: public SqlBasicSelectQueryBuilder<Sql |
256 | 243 |
|
257 | 244 | private: |
258 | 245 | SqlQueryFormatter const& _formatter; |
259 | | - SqlQueryBuilderMode _mode = SqlQueryBuilderMode::Fluent; |
260 | 246 | // mutable: see the note on _query in SqlBasicSelectQueryBuilder — the alias |
261 | 247 | // flag is part of the projection accumulator, so it follows _query's policy. |
262 | 248 | // Marked mutable so the const-qualified Field/Fields/As overloads above can |
@@ -348,9 +334,9 @@ namespace detail |
348 | 334 | /// - @c Count is intentionally not overridden — `SELECT COUNT(*) FROM ...` |
349 | 335 | /// is well-formed without an explicit column list, so the inherited |
350 | 336 | /// @c Count remains directly callable. |
351 | | -/// - @c Distinct and @c Varying are overridden via deducing this so they |
352 | | -/// return @c Self&& and the starter identity survives them. That keeps |
353 | | -/// the gate intact for `Select().Distinct().All()` while still allowing |
| 337 | +/// - @c Distinct is overridden via deducing this so it returns @c Self&& and |
| 338 | +/// the starter identity survives it. That keeps the gate intact for |
| 339 | +/// `Select().Distinct().All()` while still allowing |
354 | 340 | /// `Select().Distinct().Fields(...).All()`. |
355 | 341 | /// |
356 | 342 | /// Methods that conceptually follow the column list (@c Where, @c OrderBy, |
@@ -433,14 +419,6 @@ class [[nodiscard]] SqlSelectQueryStarter final: public SqlSelectQueryBuilder |
433 | 419 | self.SqlSelectQueryBuilder::Distinct(); |
434 | 420 | return std::forward<Self>(self); |
435 | 421 | } |
436 | | - |
437 | | - /// State-preserving override; see @ref Distinct. |
438 | | - template <typename Self> |
439 | | - LIGHTWEIGHT_FORCE_INLINE auto&& Varying(this Self&& self) noexcept |
440 | | - { |
441 | | - self.SqlSelectQueryBuilder::Varying(); |
442 | | - return std::forward<Self>(self); |
443 | | - } |
444 | 422 | }; |
445 | 423 |
|
446 | 424 | } // namespace Lightweight |
0 commit comments