-
Notifications
You must be signed in to change notification settings - Fork 52
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
refactor(pairing): move CQEx select queries to exandra #1082
refactor(pairing): move CQEx select queries to exandra #1082
Conversation
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release-1.2 #1082 +/- ##
===============================================
+ Coverage 67.03% 67.08% +0.04%
===============================================
Files 265 315 +50
Lines 7084 7635 +551
===============================================
+ Hits 4749 5122 +373
- Misses 2335 2513 +178 ☔ View full report in Codecov by Sentry. |
2220395
to
5130cf0
Compare
# Consider a failing database as a negative answer | ||
_ = | ||
Logger.warning( | ||
"Failed to verify if unconfirmed device #{Device.encode_device_id(device_id)} exists, reason: #{inspect(reason)}", | ||
"Failed to verify if unconfirmed device #{Device.encode_device_id(device_id)} exists, reason: #{inspect(err)}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since err
is always a Xandra error (Xandra.Error or Xandra.ConnectionError) we can use Exception.message(err)
instead of inspect(err)
.
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
Use Ecto to compose and run the query. Signed-off-by: Davide Briani <[email protected]>
5130cf0
to
1a31faf
Compare
What this PR does / why we need it:
Pairing runs queries through CQEx, which is deprecated, and we need to rework the project interaction with the database.
This change moves the SELECT queries to Ecto with Exandra.
Does this PR introduce a user-facing change?