diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index d521498..a7122a8 100644 --- a/.github/workflows/api-docs.yml +++ b/.github/workflows/api-docs.yml @@ -1,18 +1,14 @@ name: deploy-api-docs on: - push: - branches: - - main + push: + branches: + - main jobs: - deploy: - name: api.vapor.codes - runs-on: ubuntu-latest - steps: - - name: Deploy api-docs - uses: appleboy/ssh-action@master - with: - host: vapor.codes - username: vapor - key: ${{ secrets.VAPOR_CODES_SSH_KEY }} - script: ./github-actions/deploy-api-docs.sh + build-and-deploy: + uses: vapor/api-docs/.github/workflows/build-and-deploy-docs-workflow.yml@main + secrets: inherit + with: + package_name: fluent-postgres-driver + modules: FluentPostgresDriver + pathsToInvalidate: /fluentpostgresdriver diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3c508f..5fde29c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -160,3 +160,14 @@ jobs: uses: actions/checkout@v3 - name: Run all tests run: swift test + + test-exports: + name: Test exports + runs-on: ubuntu-latest + steps: + - name: Check out Vapor + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build + run: swift build -Xswiftc -DBUILDING_DOCC diff --git a/.spi.yml b/.spi.yml index 05c541c..04c7ade 100644 --- a/.spi.yml +++ b/.spi.yml @@ -1,3 +1,5 @@ version: 1 metadata: - authors: “Maintained by the Vapor Core Team with hundreds of contributions from the Vapor Community.” + authors: "Maintained by the Vapor Core Team with hundreds of contributions from the Vapor Community." +external_links: + documentation: "https://api.vapor.codes/fluentpostgresdriver/documentation/fluentpostgresdriver/" diff --git a/Sources/FluentPostgresDriver/Docs.docc/index.md b/Sources/FluentPostgresDriver/Docs.docc/index.md new file mode 100644 index 0000000..e6f927d --- /dev/null +++ b/Sources/FluentPostgresDriver/Docs.docc/index.md @@ -0,0 +1,3 @@ +# ``FluentPostgresDriver`` + +FluentPostgresDriver is a package to integrate PostgresNIO and and PostrgresKit with FluentKit to make it easy to use and write database operations in Swift. \ No newline at end of file diff --git a/Sources/FluentPostgresDriver/Exports.swift b/Sources/FluentPostgresDriver/Exports.swift index 0febffa..aa67deb 100644 --- a/Sources/FluentPostgresDriver/Exports.swift +++ b/Sources/FluentPostgresDriver/Exports.swift @@ -1,8 +1,17 @@ +#if !BUILDING_DOCC + @_exported import FluentKit @_exported import PostgresKit +#else + +import FluentKit +import PostgresKit + +#endif + extension DatabaseID { public static var psql: DatabaseID { return .init(string: "psql") } -} +} \ No newline at end of file diff --git a/Sources/FluentPostgresDriver/FluentPostgresConfiguration.swift b/Sources/FluentPostgresDriver/FluentPostgresConfiguration.swift index 7d04ff6..d23a3a3 100644 --- a/Sources/FluentPostgresDriver/FluentPostgresConfiguration.swift +++ b/Sources/FluentPostgresDriver/FluentPostgresConfiguration.swift @@ -1,4 +1,7 @@ import Logging +import FluentKit +import NIOCore +import PostgresKit extension DatabaseConfigurationFactory { public static func postgres( diff --git a/Sources/FluentPostgresDriver/FluentPostgresDatabase.swift b/Sources/FluentPostgresDriver/FluentPostgresDatabase.swift index e5c58ef..5614899 100644 --- a/Sources/FluentPostgresDriver/FluentPostgresDatabase.swift +++ b/Sources/FluentPostgresDriver/FluentPostgresDatabase.swift @@ -1,5 +1,6 @@ import FluentSQL import Logging +import PostgresKit struct _FluentPostgresDatabase { let database: PostgresDatabase diff --git a/Sources/FluentPostgresDriver/FluentPostgresDriver.swift b/Sources/FluentPostgresDriver/FluentPostgresDriver.swift index 197d7d1..424bda3 100644 --- a/Sources/FluentPostgresDriver/FluentPostgresDriver.swift +++ b/Sources/FluentPostgresDriver/FluentPostgresDriver.swift @@ -1,4 +1,6 @@ import Logging +import FluentKit +import PostgresKit enum FluentPostgresError: Error { case invalidURL(String) diff --git a/Sources/FluentPostgresDriver/PostgresError+Database.swift b/Sources/FluentPostgresDriver/PostgresError+Database.swift index 4df360e..5eebb88 100644 --- a/Sources/FluentPostgresDriver/PostgresError+Database.swift +++ b/Sources/FluentPostgresDriver/PostgresError+Database.swift @@ -1,4 +1,5 @@ import FluentSQL +import PostgresKit extension PostgresError: DatabaseError { public var isSyntaxError: Bool { diff --git a/Sources/FluentPostgresDriver/PostgresRow+Database.swift b/Sources/FluentPostgresDriver/PostgresRow+Database.swift index 53ec7c7..48e115f 100644 --- a/Sources/FluentPostgresDriver/PostgresRow+Database.swift +++ b/Sources/FluentPostgresDriver/PostgresRow+Database.swift @@ -1,3 +1,6 @@ +import PostgresKit +import FluentKit + extension PostgresRow { internal func databaseOutput(using decoder: PostgresDataDecoder) -> DatabaseOutput { _PostgresDatabaseOutput(