Skip to content

Commit 726bbf4

Browse files
committed
error source + metadata updates
1 parent 3235a8e commit 726bbf4

8 files changed

+60
-16
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 Qutheory, LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Package.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ let package = Package(
88
.library(name: "FluentPostgreSQL", targets: ["FluentPostgreSQL"]),
99
],
1010
dependencies: [
11-
// Swift Promises, Futures, and Streams.
12-
.package(url: "https://github.com/vapor/async.git", "1.0.0-beta.1"..<"1.0.0-beta.2"),
11+
// Promises and reactive-streams in Swift built for high-performance and scalability.
12+
.package(url: "https://github.com/vapor/async.git", from: "1.0.0-rc"),
1313

14-
// Core extensions, type-aliases, and functions that facilitate common tasks.
15-
.package(url: "https://github.com/vapor/core.git", "3.0.0-beta.1"..<"3.0.0-beta.2"),
14+
// 🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
15+
.package(url: "https://github.com/vapor/core.git", from: "3.0.0-rc"),
1616

1717
// Swift ORM framework (queries, models, and relations) for building NoSQL and SQL database integrations.
18-
.package(url: "https://github.com/vapor/fluent.git", "3.0.0-beta.3"..<"3.0.0-beta.4"),
18+
.package(url: "https://github.com/vapor/fluent.git", from: "3.0.0-rc"),
1919

20-
// Pure Swift, async/non-blocking client for PostgreSQL.
21-
.package(url: "https://github.com/vapor/postgresql.git", "1.0.0-beta.3"..<"1.0.0-beta.4"),
20+
// 🐘 Non-blocking, event-driven Swift client for PostgreSQL.
21+
.package(url: "https://github.com/vapor/postgresql.git", from: "1.0.0-rc"),
2222
],
2323
targets: [
2424
.target(name: "FluentPostgreSQL", dependencies: ["Async", "CodableKit", "Fluent", "FluentSQL", "PostgreSQL"]),

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
# fluent-postgresql
2-
Swift ORM for PostgreSQL (built on top of Fluent ORM framework)
1+
<p align="center">
2+
<img src="https://user-images.githubusercontent.com/1342803/36623958-dc6f07f0-18d7-11e8-8c6c-01737f496de9.png" height="64" alt="Fluent PostgreSQL">
3+
<br>
4+
<br>
5+
<a href="http://docs.vapor.codes/3.0/">
6+
<img src="http://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation">
7+
</a>
8+
<a href="http://vapor.team">
9+
<img src="http://vapor.team/badge.svg" alt="Slack Team">
10+
</a>
11+
<a href="LICENSE">
12+
<img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License">
13+
</a>
14+
<a href="https://circleci.com/gh/vapor/fluent-postgresql">
15+
<img src="https://circleci.com/gh/vapor/fluent-postgresql.svg?style=shield" alt="Continuous Integration">
16+
</a>
17+
<a href="https://swift.org">
18+
<img src="http://img.shields.io/badge/swift-4.1-brightgreen.svg" alt="Swift 4.1">
19+
</a>
20+
</p>

Sources/FluentPostgreSQL/PostgreSQLDatabase+QuerySupporting.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ extension PostgreSQLDatabase: QuerySupporting {
4343
reason: "Unsupported encodable type: \(type)",
4444
suggestedFixes: [
4545
"Conform \(type) to PostgreSQLDataCustomConvertible"
46-
]
46+
],
47+
source: .capture()
4748
)
4849
}
4950
return try convertible.convertToPostgreSQLData()

Sources/FluentPostgreSQL/PostgreSQLDatabase+ReferenceSupporting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extension PostgreSQLDatabase: ReferenceSupporting {
1010
/// See `ReferenceSupporting.disableReferences(on:)`
1111
public static func disableReferences(on connection: PostgreSQLConnection) -> Future<Void> {
1212
return Future(
13-
error: PostgreSQLError(identifier: "disableReferences", reason: "PostgreSQL does not support disabling foreign key checks.")
13+
error: PostgreSQLError(identifier: "disableReferences", reason: "PostgreSQL does not support disabling foreign key checks.", source: .capture())
1414
)
1515
}
1616
}

Sources/FluentPostgreSQL/PostgreSQLDatabase+SchemaSupporting.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ extension PostgreSQLDatabase: SchemaSupporting, IndexSupporting {
4545
suggestedFixes: [
4646
"Conform \(type) to `PostgreSQLColumnStaticRepresentable` to specify field type or implement a custom migration.",
4747
"Specify the `PostgreSQLColumn` manually using the schema builder in a migration."
48-
]
48+
],
49+
source: .capture()
4950
)
5051
}
5152
}

Sources/FluentPostgreSQL/PostgreSQLRowDecoder.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal final class PostgreSQLRowDecoder: Decoder {
2323

2424
func require(key: CodingKey) throws -> PostgreSQLData {
2525
guard let data = self.data[key.stringValue] else {
26-
throw PostgreSQLError(identifier: "decode", reason: "No value found at key: \(key)")
26+
throw PostgreSQLError(identifier: "decode", reason: "No value found at key: \(key)", source: .capture())
2727
}
2828
return data
2929
}
@@ -36,7 +36,8 @@ private func unsupported() -> PostgreSQLError {
3636
reason: "PostgreSQL rows only support a flat, keyed structure `[String: T]`",
3737
suggestedFixes: [
3838
"You can conform nested types to `PostgreSQLJSONType` or `PostgreSQLArrayType`. (Nested types must be `PostgreSQLDataCustomConvertible`.)"
39-
]
39+
],
40+
source: .capture()
4041
)
4142
}
4243

@@ -76,7 +77,8 @@ fileprivate struct PostgreSQLRowKeyedDecodingContainer<K>: KeyedDecodingContaine
7677
reason: "Unsupported decodable type: \(type)",
7778
suggestedFixes: [
7879
"Conform \(type) to PostgreSQLDataCustomConvertible"
79-
]
80+
],
81+
source: .capture()
8082
)
8183
}
8284
return try convertible.convertFromPostgreSQLData(decoder.require(key: key)) as! T

Sources/FluentPostgreSQL/PostgreSQLRowEncoder.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ fileprivate struct PostgreSQLRowKeyedEncodingContainer<K>: KeyedEncodingContaine
8080
reason: "Unsupported encodable type: \(type)",
8181
suggestedFixes: [
8282
"Conform \(type) to PostgreSQLDataCustomConvertible"
83-
]
83+
],
84+
source: .capture()
8485
)
8586
}
8687
encoder.data[key.stringValue] = try convertible.convertToPostgreSQLData()

0 commit comments

Comments
 (0)