Commit 29d5944
committed
refactor: organize String functions into PostgreSQL.String namespace matching PostgreSQL Chapter 9.4
Creates PostgreSQL namespace to avoid conflicts with Swift.String and organizes
all string functions into focused files following PostgreSQL documentation structure.
## New Files Created
- PostgreSQL.swift - Top-level namespace for conflict-prone functions
- String/StringNamespace.swift - PostgreSQL.String namespace definition
- String/String+CaseConversion.swift - upper(), lower(), initcap()
- String/String+Length.swift - length(), charLength(), bitLength(), octetLength()
- String/String+Trimming.swift - ltrim(), rtrim(), btrim()/trim()
- String/String+Extraction.swift - substring(), substr(), left(), right(), splitPart()
- String/String+Manipulation.swift - replacing(), translate(), overlay(), reversed(), repeated()
- String/String+Concatenation.swift - concat(), concatWithSeparator()
- String/String+Position.swift - position(), strpos()
- String/String+Padding.swift - lpad(), rpad()
- String/String+Quoting.swift - quote(), quoteLiteral(), quoteIdent()
- String/String+Utility.swift - chr(), ascii(), md5()
## Files Renamed
- Operators/String.swift → Operators/StringOperators.swift (avoid naming conflict)
## Files Deleted
- String/BasicStringFunctions.swift
- String/PostgreSQLStringFunctions.swift
- String/StringConversion.swift
- String/StringManipulation.swift
## Key Features
- **PostgreSQL.String namespace**: Avoids conflicts with Swift.String
- **Dual API pattern**: Both namespace style (PostgreSQL.String.upper()) and method style (.uppercased())
- **stdlib disambiguation**: @_disfavoredOverload on .uppercased(), .lowercased(), .reversed()
- **Backward compatibility**: Kept .upper() and .lower() alongside .uppercased()/.lowercased()
- **PostgreSQL Chapter 9.4 alignment**: File organization matches documentation structure
## Test Results
✅ All 860 tests passing
✅ No regressions from refactoring
✅ Complete string function coverage maintained1 parent 71af26d commit 29d5944
File tree
17 files changed
+1918
-911
lines changed- Sources/StructuredQueriesPostgres
- Functions/String
- Operators
17 files changed
+1918
-911
lines changedLines changed: 0 additions & 231 deletions
This file was deleted.
0 commit comments