44use crate :: {
55 block_range:: UNVERSIONED_RANGE ,
66 detail:: DeploymentDetail ,
7- pool:: PRIMARY_PUBLIC ,
7+ pool:: { PermittedConnection , PRIMARY_PUBLIC } ,
88 subgraph_store:: { unused, Shard , PRIMARY_SHARD } ,
99 AsyncPgConnection , ConnectionPool , ForeignServer , NotificationSender ,
1010} ;
@@ -779,11 +779,11 @@ mod queries {
779779/// A wrapper for a database connection that provides access to functionality
780780/// that works only on the primary database
781781pub struct Connection {
782- conn : AsyncPgConnection ,
782+ conn : PermittedConnection ,
783783}
784784
785785impl Connection {
786- pub fn new ( conn : AsyncPgConnection ) -> Self {
786+ pub fn new ( conn : PermittedConnection ) -> Self {
787787 Self { conn }
788788 }
789789
@@ -807,13 +807,13 @@ impl Connection {
807807 type TM = <AsyncPgConnection as diesel_async:: AsyncConnection >:: TransactionManager ;
808808
809809 async move {
810- TM :: begin_transaction ( & mut self . conn ) . await ?;
810+ TM :: begin_transaction ( & mut * self . conn ) . await ?;
811811 match callback ( self ) . await {
812812 Ok ( value) => {
813- TM :: commit_transaction ( & mut self . conn ) . await ?;
813+ TM :: commit_transaction ( & mut * self . conn ) . await ?;
814814 Ok ( value)
815815 }
816- Err ( user_error) => match TM :: rollback_transaction ( & mut self . conn ) . await {
816+ Err ( user_error) => match TM :: rollback_transaction ( & mut * self . conn ) . await {
817817 Ok ( ( ) ) => Err ( user_error) ,
818818 Err ( diesel:: result:: Error :: BrokenTransactionManager ) => {
819819 // In this case we are probably more interested by the
0 commit comments