Skip to content

Commit efce070

Browse files
committed
add provider and model
1 parent 0134290 commit efce070

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Service
2+
3+
/// Adds Fluent PostgreSQL's services to your project.
4+
public final class FluentPostgreSQLProvider: Provider {
5+
/// See `Provider.repositoryName`
6+
public static let repositoryName = "fluent-postgresql"
7+
8+
/// Creates a new `FluentPostgreSQLProvider`
9+
public init() {}
10+
11+
/// See `Provider.register(_:)`
12+
public func register(_ services: inout Services) throws {
13+
try services.register(FluentProvider())
14+
try services.register(PostgreSQLProvider())
15+
}
16+
17+
/// See `Provider.boot(_:)`
18+
public func boot(_ worker: Container) throws { }
19+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public protocol PostgreSQLModel: Model
2+
where Database == PostgreSQLDatabase { }
3+
4+
extension PostgreSQLModel {
5+
/// See `Model.Database`
6+
public typealias Database = PostgreSQLDatabase
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public protocol PostgreSQLPivot: Pivot
2+
where Database == PostgreSQLDatabase { }
3+
4+
extension PostgreSQLPivot {
5+
/// See `Model.Database`
6+
public typealias Database = PostgreSQLDatabase
7+
}
8+

0 commit comments

Comments
 (0)