diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index d521498..9e99004 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: mysql-kit + modules: MySQLKit + pathsToInvalidate: /mysqlkit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3a041c6..6288c7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -189,3 +189,14 @@ jobs: run: swift test --sanitize=thread env: MYSQL_HOSTNAME: '127.0.0.1' + + 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..7c8587c 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/postgreskit/documentation/postgreskit/" diff --git a/Sources/MySQLKit/ConnectionPool+MySQL.swift b/Sources/MySQLKit/ConnectionPool+MySQL.swift index bf3cc19..c4c23d6 100644 --- a/Sources/MySQLKit/ConnectionPool+MySQL.swift +++ b/Sources/MySQLKit/ConnectionPool+MySQL.swift @@ -1,3 +1,8 @@ +import NIOCore +import AsyncKit +import Logging +import MySQLNIO + extension EventLoopConnectionPool where Source == MySQLConnectionSource { public func database(logger: Logger) -> MySQLDatabase { _EventLoopConnectionPoolMySQLDatabase(pool: self, logger: logger) diff --git a/Sources/MySQLKit/Docs.docc/index.md b/Sources/MySQLKit/Docs.docc/index.md new file mode 100644 index 0000000..7fd16d8 --- /dev/null +++ b/Sources/MySQLKit/Docs.docc/index.md @@ -0,0 +1,3 @@ +# ``MySQLKit`` + +MySQLKit is a library to provide a simple Swift interface to MySQLNIO using SQLKit. diff --git a/Sources/MySQLKit/Exports.swift b/Sources/MySQLKit/Exports.swift index 1182ad1..b49b901 100644 --- a/Sources/MySQLKit/Exports.swift +++ b/Sources/MySQLKit/Exports.swift @@ -1,3 +1,10 @@ +#if !BUILDING_DOCC + @_exported import MySQLNIO @_exported import AsyncKit @_exported import SQLKit +@_exported import struct Foundation.URL +@_exported import struct Foundation.Data +@_exported import struct NIOSSL.TLSConfiguration + +#endif \ No newline at end of file diff --git a/Sources/MySQLKit/MySQLConfiguration.swift b/Sources/MySQLKit/MySQLConfiguration.swift index 150f747..1218566 100644 --- a/Sources/MySQLKit/MySQLConfiguration.swift +++ b/Sources/MySQLKit/MySQLConfiguration.swift @@ -1,6 +1,6 @@ -@_exported import struct Foundation.URL -@_exported import struct Foundation.Data -@_exported import struct NIOSSL.TLSConfiguration +import Foundation +import NIOSSL +import NIOCore public struct MySQLConfiguration { public var address: () throws -> SocketAddress diff --git a/Sources/MySQLKit/MySQLConnectionSource.swift b/Sources/MySQLKit/MySQLConnectionSource.swift index b05dcd8..f3618b9 100644 --- a/Sources/MySQLKit/MySQLConnectionSource.swift +++ b/Sources/MySQLKit/MySQLConnectionSource.swift @@ -1,3 +1,8 @@ +import NIOCore +import Logging +import MySQLNIO +import AsyncKit + public struct MySQLConnectionSource: ConnectionPoolSource { public let configuration: MySQLConfiguration diff --git a/Sources/MySQLKit/MySQLDataEncoder.swift b/Sources/MySQLKit/MySQLDataEncoder.swift index 86381b9..c1a5c9d 100644 --- a/Sources/MySQLKit/MySQLDataEncoder.swift +++ b/Sources/MySQLKit/MySQLDataEncoder.swift @@ -1,4 +1,5 @@ import Foundation +import MySQLNIO public struct MySQLDataEncoder { let json: JSONEncoder diff --git a/Sources/MySQLKit/MySQLDatabase+SQL.swift b/Sources/MySQLKit/MySQLDatabase+SQL.swift index 2bba7c4..ee3d3a9 100644 --- a/Sources/MySQLKit/MySQLDatabase+SQL.swift +++ b/Sources/MySQLKit/MySQLDatabase+SQL.swift @@ -1,3 +1,6 @@ +import MySQLNIO +import SQLKit + extension MySQLDatabase { public func sql( encoder: MySQLDataEncoder = .init(), diff --git a/Sources/MySQLKit/MySQLDialect.swift b/Sources/MySQLKit/MySQLDialect.swift index aa77df3..1d1ca4f 100644 --- a/Sources/MySQLKit/MySQLDialect.swift +++ b/Sources/MySQLKit/MySQLDialect.swift @@ -1,4 +1,6 @@ import enum Crypto.Insecure +import SQLKit +import Foundation public struct MySQLDialect: SQLDialect { public init() {} diff --git a/Sources/MySQLKit/MySQLRow+SQL.swift b/Sources/MySQLKit/MySQLRow+SQL.swift index 5e71854..5cea924 100644 --- a/Sources/MySQLKit/MySQLRow+SQL.swift +++ b/Sources/MySQLKit/MySQLRow+SQL.swift @@ -1,3 +1,6 @@ +import MySQLNIO +import SQLKit + extension MySQLRow { public func sql(decoder: MySQLDataDecoder = .init()) -> SQLRow { _MySQLSQLRow(row: self, decoder: decoder) diff --git a/Tests/MySQLKitTests/MySQLKitTests.swift b/Tests/MySQLKitTests/MySQLKitTests.swift index abd01ac..0dae67b 100644 --- a/Tests/MySQLKitTests/MySQLKitTests.swift +++ b/Tests/MySQLKitTests/MySQLKitTests.swift @@ -4,6 +4,8 @@ import SQLKitBenchmark import XCTest import NIOSSL import AsyncKit +import SQLKit +import MySQLNIO class MySQLKitTests: XCTestCase { func testSQLBenchmark() throws {