Skip to content

Commit 3fa7e36

Browse files
authored
Apply naming conventions (#10)
- apply naming conventions - updated readme
1 parent 3198bfa commit 3fa7e36

9 files changed

Lines changed: 55 additions & 47 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ test:
4747
swift test --parallel
4848

4949
docker-test:
50-
docker build -t feather-postgres-database-tests . -f ./docker/tests/Dockerfile && docker run --rm feather-postgres-database-tests
50+
docker build -t feather-database-postgres-tests . -f ./docker/tests/Dockerfile && docker run --rm feather-database-postgres-tests

Package.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var defaultSwiftSettings: [SwiftSetting] =
1111
// https://forums.swift.org/t/experimental-support-for-lifetime-dependencies-in-swift-6-2-and-beyond/78638
1212
.enableExperimentalFeature("Lifetimes"),
1313
// https://github.com/swiftlang/swift/pull/65218
14-
.enableExperimentalFeature("AvailabilityMacro=featherPostgresDatabase 1.0:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"),
14+
.enableExperimentalFeature("AvailabilityMacro=FeatherDatabasePostgres 1.0:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"),
1515
]
1616

1717
#if compiler(>=6.2)
@@ -23,7 +23,7 @@ defaultSwiftSettings.append(
2323

2424

2525
let package = Package(
26-
name: "feather-postgres-database",
26+
name: "feather-database-postgres",
2727
platforms: [
2828
.macOS(.v15),
2929
.iOS(.v18),
@@ -32,7 +32,7 @@ let package = Package(
3232
.visionOS(.v2),
3333
],
3434
products: [
35-
.library(name: "FeatherPostgresDatabase", targets: ["FeatherPostgresDatabase"]),
35+
.library(name: "FeatherDatabasePostgres", targets: ["FeatherDatabasePostgres"]),
3636
],
3737
dependencies: [
3838
.package(url: "https://github.com/apple/swift-log", from: "1.6.0"),
@@ -42,7 +42,7 @@ let package = Package(
4242
],
4343
targets: [
4444
.target(
45-
name: "FeatherPostgresDatabase",
45+
name: "FeatherDatabasePostgres",
4646
dependencies: [
4747
.product(name: "Logging", package: "swift-log"),
4848
.product(name: "PostgresNIO", package: "postgres-nio"),
@@ -51,9 +51,9 @@ let package = Package(
5151
swiftSettings: defaultSwiftSettings
5252
),
5353
.testTarget(
54-
name: "FeatherPostgresDatabaseTests",
54+
name: "FeatherDatabasePostgresTests",
5555
dependencies: [
56-
.target(name: "FeatherPostgresDatabase"),
56+
.target(name: "FeatherDatabasePostgres"),
5757
],
5858
swiftSettings: defaultSwiftSettings
5959
),

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Feather Postgres Database
1+
# Feather Database Postgres
22

33
Postgres driver implementation for the abstract [Feather Database](https://github.com/feather-framework/feather-database) Swift API package.
44

5-
[![Release: 1.0.0-beta.4](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E4-F05138)](https://github.com/feather-framework/feather-postgres-database/releases/tag/1.0.0-beta.4)
5+
[
6+
![Release: 1.0.0-beta.5](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E5-F05138)
7+
](
8+
https://github.com/feather-framework/feather-database-postgres/releases/tag/1.0.0-beta.5
9+
)
610

711
## Features
812

@@ -33,20 +37,24 @@ Postgres driver implementation for the abstract [Feather Database](https://githu
3337
Add the dependency to your `Package.swift`:
3438

3539
```swift
36-
.package(url: "https://github.com/feather-framework/feather-postgres-database", exact: "1.0.0-beta.4"),
40+
.package(url: "https://github.com/feather-framework/feather-database-postgres", exact: "1.0.0-beta.5"),
3741
```
3842

39-
Then add `FeatherPostgresDatabase` to your target dependencies:
43+
Then add `FeatherDatabasePostgres` to your target dependencies:
4044

4145
```swift
42-
.product(name: "FeatherPostgresDatabase", package: "feather-postgres-database"),
46+
.product(name: "FeatherDatabasePostgres", package: "feather-database-postgres"),
4347
```
4448

4549
## Usage
4650

4751
API documentation is available at the link below:
4852

49-
[![DocC API documentation](https://img.shields.io/badge/DocC-API_documentation-F05138)](https://feather-framework.github.io/feather-postgres-database/)
53+
[
54+
![DocC API documentation](https://img.shields.io/badge/DocC-API_documentation-F05138)
55+
](
56+
https://feather-framework.github.io/feather-database-postgres/
57+
)
5058

5159
Here is a brief example:
5260

@@ -55,7 +63,7 @@ import Logging
5563
import NIOSSL
5664
import PostgresNIO
5765
import FeatherDatabase
58-
import FeatherPostgresDatabase
66+
import FeatherDatabasePostgres
5967

6068
var logger = Logger(label: "example")
6169
logger.logLevel = .info
@@ -118,8 +126,8 @@ try await withThrowingTaskGroup(of: Void.self) { group in
118126

119127
The following database driver implementations are available for use:
120128

121-
- [SQLite](https://github.com/feather-framework/feather-sqlite-database)
122-
- [MySQL](https://github.com/feather-framework/feather-mysql-database)
129+
- [SQLite](https://github.com/feather-framework/feather-database-sqlite)
130+
- [MySQL](https://github.com/feather-framework/feather-database-mysql)
123131

124132
## Development
125133

@@ -132,4 +140,4 @@ The following database driver implementations are available for use:
132140

133141
## Contributing
134142

135-
[Pull requests](https://github.com/feather-framework/feather-postgres-database/pulls) are welcome. Please keep changes focused and include tests for new logic.
143+
[Pull requests](https://github.com/feather-framework/feather-database-postgres/pulls) are welcome. Please keep changes focused and include tests for new logic.

Sources/FeatherPostgresDatabase/PostgresDatabaseClient.swift renamed to Sources/FeatherDatabasePostgres/DatabaseClientPostgres.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
2-
// PostgresDatabaseClient.swift
3-
// feather-postgres-database
2+
// DatabaseClientPostgres.swift
3+
// feather-database-postgres
44
//
55
// Created by Tibor Bödecs on 2026. 01. 10..
66
//
@@ -12,8 +12,8 @@ import PostgresNIO
1212
/// A Postgres-backed database client.
1313
///
1414
/// Use this client to execute queries and manage transactions on Postgres.
15-
public struct PostgresDatabaseClient: DatabaseClient {
16-
public typealias Connection = PostgresDatabaseConnection
15+
public struct DatabaseClientPostgres: DatabaseClient {
16+
public typealias Connection = DatabaseConnectionPostgres
1717

1818
var client: PostgresNIO.PostgresClient
1919
var logger: Logger
@@ -46,7 +46,7 @@ public struct PostgresDatabaseClient: DatabaseClient {
4646
) async throws(DatabaseError) -> T {
4747
do {
4848
return try await client.withConnection { connection in
49-
let databaseConnection = PostgresDatabaseConnection(
49+
let databaseConnection = DatabaseConnectionPostgres(
5050
connection: connection,
5151
logger: logger
5252
)
@@ -75,7 +75,7 @@ public struct PostgresDatabaseClient: DatabaseClient {
7575
return try await client.withTransaction(
7676
logger: logger
7777
) { connection in
78-
let databaseConnection = PostgresDatabaseConnection(
78+
let databaseConnection = DatabaseConnectionPostgres(
7979
connection: connection,
8080
logger: logger
8181
)
@@ -84,7 +84,7 @@ public struct PostgresDatabaseClient: DatabaseClient {
8484
}
8585
catch let error as PostgresTransactionError {
8686
throw .transaction(
87-
PostgresDatabaseTransactionError(
87+
DatabaseTransactionErrorPostgres(
8888
underlyingError: error
8989
)
9090
)

Sources/FeatherPostgresDatabase/PostgresDatabaseConnection.swift renamed to Sources/FeatherDatabasePostgres/DatabaseConnectionPostgres.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
2-
// PostgresDatabaseConnection.swift
3-
// feather-postgres-database
2+
// DatabaseConnectionPostgres.swift
3+
// feather-database-postgres
44
//
55
// Created by Tibor Bödecs on 2026. 01. 10.
66
//
@@ -40,9 +40,9 @@ extension DatabaseQuery {
4040
}
4141
}
4242

43-
public struct PostgresDatabaseConnection: DatabaseConnection {
43+
public struct DatabaseConnectionPostgres: DatabaseConnection {
4444

45-
public typealias RowSequence = PostgresDatabaseRowSequence
45+
public typealias RowSequence = DatabaseRowSequencePostgres
4646

4747
var connection: PostgresConnection
4848
public var logger: Logger
@@ -67,7 +67,7 @@ public struct PostgresDatabaseConnection: DatabaseConnection {
6767
)
6868

6969
return try await handler(
70-
PostgresDatabaseRowSequence(
70+
DatabaseRowSequencePostgres(
7171
backingSequence: sequence
7272
)
7373
)

Sources/FeatherPostgresDatabase/PostgresDatabaseRow.swift renamed to Sources/FeatherDatabasePostgres/DatabaseRowPostgres.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//
2-
// PostgresDatabaseRow.swift
3-
// feather-postgres-database
2+
// DatabaseRowPostgres.swift
3+
// feather-database-postgres
44
//
55
// Created by Tibor Bödecs on 2026. 01. 10.
66
//
77

88
import FeatherDatabase
99
import PostgresNIO
1010

11-
public struct PostgresDatabaseRow: DatabaseRow {
11+
public struct DatabaseRowPostgres: DatabaseRow {
1212

1313
var row: PostgresRow
1414

Sources/FeatherPostgresDatabase/PostgresDatabaseRowSequence.swift renamed to Sources/FeatherDatabasePostgres/DatabaseRowSequencePostgres.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
2-
// PostgresDatabaseRowSequence.swift
3-
// feather-postgres-database
2+
// DatabaseRowSequencePostgres.swift
3+
// feather-database-postgres
44
//
55
// Created by Tibor Bödecs on 2026. 01. 10.
66
//
@@ -11,7 +11,7 @@ import PostgresNIO
1111
/// A query result backed by a Postgres row sequence.
1212
///
1313
/// Use this type to iterate or collect Postgres query results.
14-
public struct PostgresDatabaseRowSequence: DatabaseRowSequence {
14+
public struct DatabaseRowSequencePostgres: DatabaseRowSequence {
1515

1616
var backingSequence: PostgresRowSequence
1717

@@ -28,7 +28,7 @@ public struct PostgresDatabaseRowSequence: DatabaseRowSequence {
2828
/// - Returns: The next `PostgresRow`, or `nil` when finished.
2929
#if compiler(>=6.2)
3030
@concurrent
31-
public mutating func next() async throws -> PostgresDatabaseRow? {
31+
public mutating func next() async throws -> DatabaseRowPostgres? {
3232
guard !Task.isCancelled else {
3333
return nil
3434
}
@@ -65,8 +65,8 @@ public struct PostgresDatabaseRowSequence: DatabaseRowSequence {
6565
/// This consumes the sequence and returns all rows.
6666
/// - Throws: An error if iteration fails.
6767
/// - Returns: An array of `PostgresRow` values.
68-
public func collect() async throws -> [PostgresDatabaseRow] {
69-
var items: [PostgresDatabaseRow] = []
68+
public func collect() async throws -> [DatabaseRowPostgres] {
69+
var items: [DatabaseRowPostgres] = []
7070
for try await item in self {
7171
items.append(item)
7272
}

Sources/FeatherPostgresDatabase/PostgresDatabaseTransactionError.swift renamed to Sources/FeatherDatabasePostgres/DatabaseTransactionErrorPostgres.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//
2-
// PostgresDatabaseTransactionError.swift
3-
// feather-postgres-database
2+
// DatabaseTransactionErrorPostgres.swift
3+
// feather-database-postgres
44
//
55
// Created by Tibor Bödecs on 2026. 02. 02..
66
//
77

88
import FeatherDatabase
99
import PostgresNIO
1010

11-
public struct PostgresDatabaseTransactionError: DatabaseTransactionError {
11+
public struct DatabaseTransactionErrorPostgres: DatabaseTransactionError {
1212

1313
var underlyingError: PostgresTransactionError
1414

Tests/FeatherPostgresDatabaseTests/FeatherPostgresDatabaseTestSuite.swift renamed to Tests/FeatherDatabasePostgresTests/FeatherDatabasePostgresTestSuite.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
2-
// FeatherPostgresDatabaseTestSuite.swift
3-
// feather-postgres-database
2+
// FeatherDatabasePostgresTestSuite.swift
3+
// feather-database-postgres
44
//
55
// Created by Tibor Bödecs on 2026. 01. 10..
66
//
@@ -11,7 +11,7 @@ import NIOSSL
1111
import PostgresNIO
1212
import Testing
1313

14-
@testable import FeatherPostgresDatabase
14+
@testable import FeatherDatabasePostgres
1515

1616
#if canImport(FoundationEssentials)
1717
import FoundationEssentials
@@ -20,7 +20,7 @@ import Foundation
2020
#endif
2121

2222
@Suite
23-
struct FeatherPostgresDatabaseTestSuite {
23+
struct FeatherDatabasePostgresTestSuite {
2424

2525
private func randomTableSuffix() -> String {
2626
let characters = Array("abcdefghijklmnopqrstuvwxyz0123456789")
@@ -34,7 +34,7 @@ struct FeatherPostgresDatabaseTestSuite {
3434

3535
private func runUsingTestDatabaseClient(
3636
_ closure:
37-
@escaping (@Sendable (PostgresDatabaseClient) async throws -> Void)
37+
@escaping (@Sendable (DatabaseClientPostgres) async throws -> Void)
3838
) async throws {
3939
var logger = Logger(label: "test")
4040
logger.logLevel = .info
@@ -66,7 +66,7 @@ struct FeatherPostgresDatabaseTestSuite {
6666
backgroundLogger: logger
6767
)
6868

69-
let database = PostgresDatabaseClient(
69+
let database = DatabaseClientPostgres(
7070
client: client,
7171
logger: logger
7272
)

0 commit comments

Comments
 (0)