Skip to content

Commit 00c6d6e

Browse files
committed
Renamed
1 parent e1842b2 commit 00c6d6e

173 files changed

Lines changed: 831 additions & 813 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/launch.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"configurations": [
3+
{
4+
"type": "swift",
5+
"request": "launch",
6+
"args": [],
7+
"cwd": "${workspaceFolder:Otter}",
8+
"name": "Debug OtterCLI",
9+
"program": "${workspaceFolder:Otter}/.build/debug/OtterCLI",
10+
"preLaunchTask": "swift: Build Debug OtterCLI"
11+
},
12+
{
13+
"type": "swift",
14+
"request": "launch",
15+
"args": [],
16+
"cwd": "${workspaceFolder:Otter}",
17+
"name": "Release OtterCLI",
18+
"program": "${workspaceFolder:Otter}/.build/release/OtterCLI",
19+
"preLaunchTask": "swift: Build Release OtterCLI"
20+
}
21+
]
22+
}

Package.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import CompilerPluginSupport
55
import PackageDescription
66

77
let package = Package(
8-
name: "Feather",
8+
name: "Otter",
99
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13)],
1010
products: [
11-
.library(name: "Feather", targets: ["Feather"]),
11+
.library(name: "Otter", targets: ["Otter"]),
1212
.library(name: "Compiler", targets: ["Compiler"]),
13-
.executable(name: "FeatherCLI", targets: ["FeatherCLI"]),
13+
.executable(name: "OtterCLI", targets: ["OtterCLI"]),
1414
],
1515
dependencies: [
1616
.package(url: "https://github.com/apple/swift-syntax.git", from: "601.0.1"),
@@ -19,7 +19,7 @@ let package = Package(
1919
],
2020
targets: [
2121
.macro(
22-
name: "FeatherMacros",
22+
name: "OtterMacros",
2323
dependencies: [
2424
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
2525
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
@@ -28,13 +28,13 @@ let package = Package(
2828
),
2929

3030
.target(
31-
name: "Feather",
31+
name: "Otter",
3232
dependencies: [
33-
"FeatherMacros",
34-
.product(name: "Collections", package: "swift-collections")
33+
"OtterMacros",
34+
.product(name: "Collections", package: "swift-collections"),
3535
]
3636
),
37-
37+
3838
.target(
3939
name: "Compiler",
4040
dependencies: [
@@ -45,16 +45,16 @@ let package = Package(
4545
),
4646

4747
.executableTarget(
48-
name: "FeatherCLI",
48+
name: "OtterCLI",
4949
dependencies: [
5050
"Compiler",
5151
.product(name: "ArgumentParser", package: "swift-argument-parser"),
5252
]
5353
),
54-
54+
5555
.testTarget(
56-
name: "FeatherTests",
57-
dependencies: ["Feather", "Compiler"]
56+
name: "OtterTests",
57+
dependencies: ["Otter", "Compiler"]
5858
),
5959

6060
.testTarget(

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<picture>
2-
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/wickwirew/Feather/blob/main/Otter~dark.png?raw=true">
3-
<source media="(prefers-color-scheme: light)" srcset="https://github.com/wickwirew/Feather/blob/main/Otter.png?raw=true">
2+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/wickwirew/Otter/blob/main/Otter~dark.png?raw=true">
3+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/wickwirew/Otter/blob/main/Otter.png?raw=true">
44
<p align="center">
5-
<img alt="Otter" src="https://github.com/wickwirew/Feather/blob/main/Otter.png?raw=true" width=40% height=40%>
5+
<img alt="Otter" src="https://github.com/wickwirew/Otter/blob/main/Otter.png?raw=true" width=40% height=40%>
66
</p>
77
</picture>
88

@@ -116,7 +116,7 @@ Otter supports Swift Package Manager. To install add the following to your `Pack
116116
let package = Package(
117117
[...]
118118
dependencies: [
119-
.Package(url: "https://github.com/wickwirew/Feather.git", from: "...")
119+
.Package(url: "https://github.com/wickwirew/Otter.git", from: "...")
120120
]
121121
)
122122
```

Sources/Compiler/Columns.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Columns.swift
3-
// Feather
3+
// Otter
44
//
55
// Created by Wes Wickwire on 6/2/25.
66
//

Sources/Compiler/Compiler.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Compiler.swift
3-
// Feather
3+
// Otter
44
//
55
// Created by Wes Wickwire on 2/21/25.
66
//
@@ -96,7 +96,7 @@ public struct Compiler {
9696
///
9797
/// Having a basically a wrapper that just holds onto the source
9898
/// and kicks off the compilation seemed cleaner.
99-
fileprivate struct CompilerWithSource {
99+
private struct CompilerWithSource {
100100
var schema: Schema
101101
let source: String
102102
var pragmas: PragmaAnalyzer

Sources/Compiler/Diagnostic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Diagnostic.swift
3-
// Feather
3+
// Otter
44
//
55
// Created by Wes Wickwire on 2/16/25.
66
//

Sources/Compiler/DiagnosticReporter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// DiagnosticReporter.swift
3-
// Feather
3+
// Otter
44
//
55
// Created by Wes Wickwire on 5/3/25.
66
//

Sources/Compiler/Driver.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Driver.swift
3-
// Feather
3+
// Otter
44
//
55
// Created by Wes Wickwire on 5/14/25.
66
//
@@ -81,14 +81,14 @@ public actor Driver {
8181
try measure("Generation") {
8282
// An array of all migrations source code
8383
let migrations = results.values
84-
.filter{ $0.usage == .migration }
84+
.filter { $0.usage == .migration }
8585
.sorted(by: { $0.fileName < $1.fileName })
8686
.flatMap(\.statements)
8787
.map(\.sanitizedSource)
8888

8989
// An array of all queries grouped by their file name
9090
let queries = results.values
91-
.filter{ $0.usage == .queries }
91+
.filter { $0.usage == .queries }
9292
.map { ($0.fileName.split(separator: ".").first?.description, $0.statements) }
9393

9494
let hasDiagnostics = results.contains { $0.value.diagnostics.contains { $0.level == .error } }

Sources/Compiler/Function.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Function.swift
3-
// Feather
3+
// Otter
44
//
55
// Created by Wes Wickwire on 6/7/25.
66
//
@@ -51,7 +51,6 @@ struct Function: Sendable {
5151
genericTypes.append(result)
5252
}
5353

54-
5554
self.genericTypes = genericTypes.distinct()
5655
self.params = params
5756
self.result = result

Sources/Compiler/Gen/Language.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Language.swift
3-
// Feather
3+
// Otter
44
//
55
// Created by Wes Wickwire on 4/28/25.
66
//
@@ -66,7 +66,7 @@ extension Language {
6666
queries: [(String?, [GeneratedQuery])]
6767
) {
6868
let tables = Dictionary(schema.tables.map { ($0.key.name, model(for: $0.value)) }, uniquingKeysWith: { $1 })
69-
let queries = queries.map { ($0.map { "\($0)Queries" }, $1.map{ query(for: $0, tables: tables) }) }
69+
let queries = queries.map { ($0.map { "\($0)Queries" }, $1.map { query(for: $0, tables: tables) }) }
7070
return (Array(tables.values), queries)
7171
}
7272

@@ -85,9 +85,9 @@ extension Language {
8585
// question marks for any input.
8686
let sql = statement.sourceSegments.map { segment in
8787
switch segment {
88-
case .text(let text):
88+
case let .text(text):
8989
return text.description
90-
case .rowParam(let param):
90+
case let .rowParam(param):
9191
return interpolatedQuestionMarks(
9292
for: statement.parameters.count > 1 ? param.name : "input"
9393
)
@@ -185,7 +185,8 @@ extension Language {
185185
// Output can be mapped to a table struct
186186
if statement.resultColumns.chunks.count == 1,
187187
let tableName = firstResultColumns.table,
188-
let table = tables[tableName] {
188+
let table = tables[tableName]
189+
{
189190
return .model(table)
190191
}
191192

@@ -302,16 +303,16 @@ public enum BuiltinOrGenerated: CustomStringConvertible {
302303

303304
public var description: String {
304305
switch self {
305-
case .builtin(let builtin, let isArray, _):
306+
case let .builtin(builtin, isArray, _):
306307
isArray ? "[\(builtin)]" : builtin
307-
case .model(let model):
308+
case let .model(model):
308309
model.name
309310
}
310311
}
311312

312313
public func namespaced(to namespace: String) -> String {
313314
switch self {
314-
case .model(let model) where !model.isTable: "\(namespace).\(self)"
315+
case let .model(model) where !model.isTable: "\(namespace).\(self)"
315316
default: description
316317
}
317318
}

0 commit comments

Comments
 (0)