Skip to content

Add API Docs #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 24, 2023
Merged
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
24 changes: 10 additions & 14 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -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/"
3 changes: 3 additions & 0 deletions Sources/FluentPostgresDriver/Docs.docc/index.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 10 additions & 1 deletion Sources/FluentPostgresDriver/Exports.swift
Original file line number Diff line number Diff line change
@@ -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")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Logging
import FluentKit
import NIOCore
import PostgresKit

extension DatabaseConfigurationFactory {
public static func postgres(
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FluentSQL
import Logging
import PostgresKit

struct _FluentPostgresDatabase {
let database: PostgresDatabase
2 changes: 2 additions & 0 deletions Sources/FluentPostgresDriver/FluentPostgresDriver.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Logging
import FluentKit
import PostgresKit

enum FluentPostgresError: Error {
case invalidURL(String)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FluentSQL
import PostgresKit

extension PostgresError: DatabaseError {
public var isSyntaxError: Bool {
3 changes: 3 additions & 0 deletions Sources/FluentPostgresDriver/PostgresRow+Database.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import PostgresKit
import FluentKit

extension PostgresRow {
internal func databaseOutput(using decoder: PostgresDataDecoder) -> DatabaseOutput {
_PostgresDatabaseOutput(