Skip to content

Commit 025ec10

Browse files
committed
more renames
1 parent e563593 commit 025ec10

7 files changed

Lines changed: 17 additions & 18 deletions

File tree

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ brew install TODO FIX THIS ONCE IT IS ACTUALLY IN BREW
128128

129129
Once the project has been added it is time to setup the queries and migrations folders. In the root of the project where you want everything to live, in terminal run the following command
130130
```
131-
feather init
131+
otter init
132132
```
133133

134-
This will create all diretories needed and will create your first migration. Your project should have 2 new folders and a swift file. In the migrations folder you will have a file named `1.sql`. You put your first migration code in there. The `Queries.swift` file is what the generated Swift code will be written too. The `gen` command will automatically recreate this if it gets deleted.
134+
This will create all diretories needed and will create your first migration. Your project should have 2 new folders and a swift file. In the migrations folder you will have a file named `1.sql`. You put your first migration code in there.
135135
```
136136
/Migrations/1.sql
137137
/Queries
138-
Queries.swift
139138
```
140139

141140
> [!TIP]
@@ -144,15 +143,15 @@ Queries.swift
144143
#### Generating the Database
145144
Once you have your first migration in and the project setup you can now generate the database. In the same directory where `init` was run, you run the `gen` command.
146145
```
147-
feather gen
146+
otter gen --output Queries.swift
148147
```
149148

150149
This will compile and check all migrations and queries, then generate all Swift required to talk to the database.
151150

152151
### Adding a New Migration
153152
When a new migration is needed, you can simply add a new file with a number 1 higher than the previous. To automatically do this the cli tool can do it for you by running
154153
```
155-
feather migrate add
154+
otter migrate add
156155
```
157156

158157
# Opening a Connection
@@ -179,7 +178,7 @@ let database = try DB(config: config)
179178
# Queries
180179
All queries will be stored in the `/Queries` directory. More than one query can go in each file. To get started, create a new file in the `/Queries` directory. The cli can do this automatically. In the same directory where `init` was run, execute
181180
```
182-
feather queries add --name <some-name>
181+
otter queries add --name <some-name>
183182
```
184183

185184
Open the file that was created in `/Queries`, it should be blank. Individual queries can be defined using the the following format. At the moment a single query can only have one statement.

Sources/Compiler/Compiler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private struct CompilerWithSource {
108108
) -> (Statement, Diagnostics) {
109109
// Calculating the statement signature will type check it.
110110
// We can just ignore the output
111-
var typeChecker = StmtTypeChecker(schema: schema, pragmas: pragmas.featherPragmas)
111+
var typeChecker = StmtTypeChecker(schema: schema, pragmas: pragmas.otterPragmas)
112112
let (parameters, type) = typeChecker.signature(for: stmt)
113113

114114
// Note: Make sure to pass env from type checker to make sure all is imported

Sources/Compiler/Sema/PragmaAnalyzer.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ public struct OtterPragmas: OptionSet, Sendable {
1515
public static let requireStrictTables = OtterPragmas(rawValue: 1 << 0)
1616

1717
public enum Keys {
18-
public static let requireStrictTables = "feather_require_strict_tables"
18+
public static let requireStrictTables = "otter_require_strict_tables"
1919
}
2020
}
2121

2222
struct PragmaAnalyzer {
23-
private(set) var featherPragmas: OtterPragmas
23+
private(set) var otterPragmas: OtterPragmas
2424
private var diagnostics = Diagnostics()
2525
private var isStaticallyTrue = IsStaticallyTrue(allowOnOffYesNo: true)
2626

27-
init(featherPragmas: OtterPragmas = OtterPragmas()) {
28-
self.featherPragmas = featherPragmas
27+
init(otterPragmas: OtterPragmas = OtterPragmas()) {
28+
self.otterPragmas = otterPragmas
2929
}
3030

3131
var allDiagnostics: Diagnostics {
3232
return diagnostics.merging(isStaticallyTrue.diagnostics)
3333
}
3434

3535
func isOn(_ pragma: OtterPragmas) -> Bool {
36-
return featherPragmas.contains(pragma)
36+
return otterPragmas.contains(pragma)
3737
}
3838

3939
mutating func handle(pragma: PragmaStmtSyntax) {
@@ -45,9 +45,9 @@ struct PragmaAnalyzer {
4545
}
4646

4747
if isStaticallyTrue.isTrue(expr) {
48-
featherPragmas.insert(.requireStrictTables)
48+
otterPragmas.insert(.requireStrictTables)
4949
} else {
50-
featherPragmas.remove(.requireStrictTables)
50+
otterPragmas.remove(.requireStrictTables)
5151
}
5252
case "journal_mode":
5353
diagnostics.add(.init(

Sources/Otter/Migration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
public enum MigrationRunner {
9-
static let migrationTableName = "__featherMigrations"
9+
static let migrationTableName = "__otterMigrations"
1010

1111
public static func execute(migrations: [String], pool: ConnectionPool) async throws {
1212
try await pool.begin(.write) { tx in

Sources/Otter/OtterError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// FeatherError.swift
2+
// OtterError.swift
33
// Otter
44
//
55
// Created by Wes Wickwire on 2/16/25.

Sources/OtterCLI/Otter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Feather.swift
2+
// Otter.swift
33
// OtterCLI
44
//
55
// Created by Wes Wickwire on 1/18/24.

Tests/CompilerTests/Compiler/CompileTableSchema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CREATE TABLE bar (
3434
PRIMARY KEY (foo, baz)
3535
);
3636

37-
PRAGMA feather_require_strict_tables = TRUE;
37+
PRAGMA otter_require_strict_tables = TRUE;
3838

3939
-- CHECK: TABLE
4040
-- CHECK: NAME main.baz

0 commit comments

Comments
 (0)