Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

DatabaseKit 2.0 #53

Merged
merged 13 commits into from
Feb 7, 2019
Merged

DatabaseKit 2.0 #53

merged 13 commits into from
Feb 7, 2019

Conversation

tanner0101
Copy link
Member

@tanner0101 tanner0101 commented Nov 14, 2018

This PR updates DatabaseKit to rely solely on SwiftNIO, making it more widely accessible to the server-side Swift ecosystem. It also updates DatabaseConnectionPool to share connections across event loops. This will make it easier to inject connection pools into various dependencies, without needing to ensure there is only one pool initialized per thread.

  • Prefix new.. -> make..

@tanner0101 tanner0101 added the enhancement New feature or request label Nov 14, 2018
@tanner0101 tanner0101 self-assigned this Nov 14, 2018
/// Creates a new `DatabaseConnection` that will perform async work on the supplied `Worker`.
///
/// let conn = try database.newConnection(on: ...).wait()
///
/// - parameters:
/// - worker: `Worker` to perform async work on.
func newConnection(on worker: Worker) -> Future<Connection>
func newConnection() -> EventLoopFuture<Connection>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be makeConnection() as per the Swift API Design Guidelines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mordil yeah, I think it should. I've added this to the TODO, thanks.

@tanner0101 tanner0101 merged commit 6f7099a into master Feb 7, 2019
@penny-coin
Copy link

Hey @tanner0101, you just merged a pull request, have a coin!

You now have 1012 coins.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants