Fix Missing Connection Metadata #232
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 65.09%. Comparing base (
26fe819) to head (4e64aa3).<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #232 +/- ##
==========================================
+ Coverage 64.36% 65.09% +0.72%
==========================================
Files 12 12
Lines 609 616 +7
==========================================
+ Hits 392 401 +9
+ Misses 217 215 -2
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...tPostgresDriver/FluentPostgresClientDatabase.swift | 88.34% <100.00%> (+0.34%) | :arrow_up: |
| .../FluentPostgresDriver/FluentPostgresDatabase.swift | 70.49% <100.00%> (+5.57%) | :arrow_up: |
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
We should use https://github.com/vapor/postgres-kit/blob/main/Sources/PostgresKit/PostgresConnectionDatabase.swift#L10 here and pass the logger to the sql method
Here as well
We should not be using PostgresDatabase anymore
We had to add this to avoid a crash in withConnection in a transaction
We don't need this, Sorry, I was on mobile and misread. Only the FluentPostgresClientDatabase should use the new .sql method taking a logger. The current FluentPostgresDatabase can stay as it is, with the new major it will be deprecated along with PostgresDatabase
Done!
ptoffy
0xTim
Resolves https://github.com/vapor/fluent-postgres-driver/issues/230
The only metadata that is set in the stack is the connection ID, so make sure we copy that over into a new logger. Can't do the other way around in case we pollute other loggers. I'll be glad when we can remove all these hacks and just use task locals...