You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the Service struct stores a generic conn value. but supporting mock assertions requires changing conn to a reference. and if conn is a reference, then it must also be mutable since the create_transaction_tx function requires a mutable reference to self. now the database connection is stored as a reference to a mutable, generic value just to enable testing. may as well be javascript
short term solution:
separate the create_transaction_tx function into its own service
change conn to a reference
add test coverage to the reduced Service impl
long term solution:
create a composite postgres type that combines transaction, transaction_item and approval
replace the tokio_postgrestransaction requiring a mutable reference to self with a postgres function. switching to a postgres function also avoids creating a massive common table expression to insert on the transaction, transaction_item and approval tables
hourly estimate
32 service impl functions x 10 mins: 5
make: 0.25
workflows: 1
testing: 2
doc: 0
8.25
The text was updated successfully, but these errors were encountered:
current
absent crates/service unit test coverage
expected
crates/service unit test coverage
the Service struct stores a generic
conn
value. but supporting mock assertions requires changingconn
to a reference. and ifconn
is a reference, then it must also be mutable since thecreate_transaction_tx
function requires a mutable reference toself
. now the database connection is stored as a reference to a mutable, generic value just to enable testing. may as well be javascriptshort term solution:
create_transaction_tx
function into its own serviceconn
to a referenceService
impllong term solution:
transaction
,transaction_item
andapproval
tokio_postgres
transaction requiring a mutable reference toself
with a postgres function. switching to a postgres function also avoids creating a massive common table expression to insert on thetransaction
,transaction_item
andapproval
tableshourly estimate
8.25
The text was updated successfully, but these errors were encountered: