@@ -59,12 +59,12 @@ impl Builder<()> {
59
59
auth_token,
60
60
connector: None ,
61
61
version: None ,
62
+ namespace: None ,
62
63
} ,
63
64
encryption_config: None ,
64
65
read_your_writes: true ,
65
66
sync_interval: None ,
66
67
http_request_callback: None ,
67
- namespace: None ,
68
68
skip_safety_assert: false ,
69
69
#[ cfg( feature = "sync" ) ]
70
70
sync_protocol: Default :: default ( ) ,
@@ -102,6 +102,7 @@ impl Builder<()> {
102
102
auth_token,
103
103
connector: None ,
104
104
version: None ,
105
+ namespace: None ,
105
106
} ,
106
107
connector: None ,
107
108
read_your_writes: true ,
@@ -122,6 +123,7 @@ impl Builder<()> {
122
123
auth_token,
123
124
connector: None ,
124
125
version: None ,
126
+ namespace: None ,
125
127
} ,
126
128
}
127
129
}
@@ -135,6 +137,7 @@ cfg_replication_or_remote_or_sync! {
135
137
auth_token: String ,
136
138
connector: Option <crate :: util:: ConnectorService >,
137
139
version: Option <String >,
140
+ namespace: Option <String >,
138
141
}
139
142
}
140
143
@@ -223,7 +226,6 @@ cfg_replication! {
223
226
read_your_writes: bool ,
224
227
sync_interval: Option <std:: time:: Duration >,
225
228
http_request_callback: Option <crate :: util:: HttpRequestCallback >,
226
- namespace: Option <String >,
227
229
skip_safety_assert: bool ,
228
230
#[ cfg( feature = "sync" ) ]
229
231
sync_protocol: super :: SyncProtocol ,
@@ -300,7 +302,7 @@ cfg_replication! {
300
302
/// Set the namespace that will be communicated to remote replica in the http header.
301
303
pub fn namespace( mut self , namespace: impl Into <String >) -> Builder <RemoteReplica >
302
304
{
303
- self . inner. namespace = Some ( namespace. into( ) ) ;
305
+ self . inner. remote . namespace = Some ( namespace. into( ) ) ;
304
306
self
305
307
}
306
308
@@ -334,12 +336,12 @@ cfg_replication! {
334
336
auth_token,
335
337
connector,
336
338
version,
339
+ namespace,
337
340
} ,
338
341
encryption_config,
339
342
read_your_writes,
340
343
sync_interval,
341
344
http_request_callback,
342
- namespace,
343
345
skip_safety_assert,
344
346
#[ cfg( feature = "sync" ) ]
345
347
sync_protocol,
@@ -500,6 +502,7 @@ cfg_replication! {
500
502
auth_token,
501
503
connector,
502
504
version,
505
+ namespace,
503
506
} ) = remote
504
507
{
505
508
let connector = if let Some ( connector) = connector {
@@ -524,6 +527,7 @@ cfg_replication! {
524
527
flags,
525
528
encryption_config. clone( ) ,
526
529
http_request_callback,
530
+ namespace,
527
531
)
528
532
. await ?
529
533
} else {
@@ -606,6 +610,7 @@ cfg_sync! {
606
610
auth_token,
607
611
connector: _,
608
612
version: _,
613
+ namespace: _,
609
614
} ,
610
615
connector,
611
616
remote_writes,
@@ -730,13 +735,21 @@ cfg_remote! {
730
735
self
731
736
}
732
737
738
+ /// Set the namespace that will be communicated to the remote in the http header.
739
+ pub fn namespace( mut self , namespace: impl Into <String >) -> Builder <Remote >
740
+ {
741
+ self . inner. namespace = Some ( namespace. into( ) ) ;
742
+ self
743
+ }
744
+
733
745
/// Build the remote database client.
734
746
pub async fn build( self ) -> Result <Database > {
735
747
let Remote {
736
748
url,
737
749
auth_token,
738
750
connector,
739
751
version,
752
+ namespace,
740
753
} = self . inner;
741
754
742
755
let connector = if let Some ( connector) = connector {
@@ -758,6 +771,7 @@ cfg_remote! {
758
771
auth_token,
759
772
connector,
760
773
version,
774
+ namespace,
761
775
} ,
762
776
max_write_replication_index: Default :: default ( ) ,
763
777
} )
0 commit comments