Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,5 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate certificates
run: make test-certs
- name: Start Postgres Docker Container
run: docker compose up -d --build
- name: Wait For Postgres Docker Container
run: |
for i in {1..30}; do
if docker compose exec -T postgres pg_isready -U postgres -d postgres; then
exit 0
fi
sleep 1
done
docker compose logs postgres
exit 1
- name: Run Tests
run: swift test --parallel
- name: Stop Postgres Docker Container
if: always()
run: docker compose down -v
- name: Run Docker Tests
run: make docker-test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ test:
swift test --parallel

docker-test:
docker build -t feather-database-postgres-tests . -f ./docker/tests/Dockerfile && docker run --rm feather-database-postgres-tests
make test-certs && docker compose up --build --abort-on-container-exit --exit-code-from test test
6 changes: 3 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-log", from: "1.6.0"),
.package(url: "https://github.com/vapor/postgres-nio", from: "1.27.0"),
.package(url: "https://github.com/feather-framework/feather-database", exact: "1.0.0-beta.5"),
.package(url: "https://github.com/feather-framework/feather-database", exact: "1.0.0-rc.1"),
// [docc-plugin-placeholder]
],
targets: [
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Postgres driver implementation for the abstract [Feather Database](https://github.com/feather-framework/feather-database) Swift API package.

[
![Release: 1.0.0-beta.6](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E6-F05138)
![Release: 1.0.0-rc.1](https://img.shields.io/badge/Release-1%2E0%2E0--rc%2E1-F05138)
](
https://github.com/feather-framework/feather-database-postgres/releases/tag/1.0.0-beta.6
https://github.com/feather-framework/feather-database-postgres/releases/tag/1.0.0-rc.1
)

## Features
Expand Down Expand Up @@ -37,7 +37,7 @@ Postgres driver implementation for the abstract [Feather Database](https://githu
Add the dependency to your `Package.swift`:

```swift
.package(url: "https://github.com/feather-framework/feather-database-postgres", exact: "1.0.0-beta.6"),
.package(url: "https://github.com/feather-framework/feather-database-postgres", exact: "1.0.0-rc.1"),
```

Then add `FeatherDatabasePostgres` to your target dependencies:
Expand Down Expand Up @@ -119,9 +119,6 @@ try await withThrowingTaskGroup(of: Void.self) { group in
}
```

> [!WARNING]
> This repository is a work in progress, things can break until it reaches v1.0.0.

## Other database drivers

The following database driver implementations are available for use:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import PostgresNIO
///
/// Use this type to iterate or collect Postgres query results.
public struct DatabaseRowSequencePostgres: DatabaseRowSequence {
public typealias Row = DatabaseRowPostgres

var backingSequence: PostgresRowSequence

Expand All @@ -38,14 +39,14 @@ public struct DatabaseRowSequencePostgres: DatabaseRowSequence {
return .init(row: postgresRow)
}
#else
public mutating func next() async throws -> PostgresRow? {
public mutating func next() async throws -> DatabaseRowPostgres? {
guard !Task.isCancelled else {
return nil
}
guard let postgresRow = try await backingIterator.next() else {
return nil
}
return postgresRow
return .init(row: postgresRow)
}
#endif
}
Expand Down
Loading
Loading