Closed johnbona closed 7 years ago
Merging #29 into master will increase coverage by
0.03%
. The diff coverage is93.75%
.
@@ Coverage Diff @@
## master #29 +/- ##
==========================================
+ Coverage 92.61% 92.65% +0.03%
==========================================
Files 13 14 +1
Lines 1815 1879 +64
==========================================
+ Hits 1681 1741 +60
- Misses 134 138 +4
Impacted Files | Coverage Δ | |
---|---|---|
Sources/PostgreSQL/Notification.swift | 100% <100%> (ø) |
|
Tests/PostgreSQLTests/PostgreSQLTests.swift | 96.23% <100%> (+0.19%) |
:arrow_up: |
Sources/PostgreSQL/Database.swift | 84.61% <85.71%> (+2.79%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ff6bd68...fdb0d0b. Read the comment docs.
@natebird Made the changes you requested and also found a slight performance increase using string concatenation instead of interpolation when constructing the SQL statements, especially for large NOTIFY
payloads.
@tanner0101 @LoganWright - do you know why CircleCI isn't responding to PRs on this repo?
Circle only responds to PRs which are started from this repo, not external forks. I don't know why it's so.
The typical workaround for me was to push the other branch here and start a new PR - you should be able to do this with your permissions.
@vzsg I figured out the issue. It is a setting in Circle. @johnbona can you push an empty commit to this branch again to kick Circle?
Sorry, I couldn't resist :)
Yay!
@johnbona can you review this again? The tests are failing.
Now that we have a 2.0 Beta release for this repo we can merge this PR into the 2.0 release.
Thanks!
@natebird Should be good now!
I'm not all that comfortable with
libpq
so give this extra scrutiny. 🙊I used this example heavily to help me determine how to receive notifications using
libpq
. I also purposefully broke convention and used a closure inlisten
instead of creating aonNotification
property offDatabase
since a database could be listening to multiple channels simultaneously.Couple of things that I wanted to point out for feedback:
listen
since the closure intry background
can't throw? UsingfatalError
right now but not sure if that's the correct approach.Notification
struct. It's not really meant to be used outside thelisten
closure so it's maybe okay to keep named as is even though it collides with Foundation's ownNotification
.