pub struct DataverseSourceConfig {
pub environment_url: String,
pub tenant_id: String,
pub client_id: String,
pub client_secret: String,
pub entities: Vec<String>,
pub entity_set_overrides: HashMap<String, String>,
pub entity_columns: HashMap<String, Vec<String>>,
pub min_interval_ms: u64,
pub max_interval_seconds: u64,
pub api_version: String,
}Expand description
Configuration for the Dataverse replication source.
Mirrors the platform Dataverse source configuration which uses
RetrieveEntityChangesRequest for change tracking. In the Rust/Web API
implementation, this is achieved via OData change tracking with
Prefer: odata.track-changes headers and delta links.
§Required Configuration
environment_url: The Dataverse environment URL (e.g.,https://myorg.crm.dynamics.com)entities: List of entity logical names to monitor (e.g.,["account", "contact"])- Authentication (one of):
- Identity provider via [
DataverseSource::builder].with_identity_provider()(recommended) tenant_id+client_id+client_secretfor client credentials flow
- Identity provider via [
§Optional Configuration
entity_set_overrides: Override computed entity set names for specific entitiesmin_interval_ms: Minimum adaptive polling interval (default: 500)max_interval_seconds: Maximum adaptive polling interval (default: 30)api_version: Dataverse Web API version (default:v9.2)
Fields§
§environment_url: StringDataverse environment URL (e.g., https://myorg.crm.dynamics.com).
tenant_id: StringAzure AD / Microsoft Entra ID tenant ID for OAuth2 authentication. Required for the built-in client credentials flow. Not required when an identity provider is injected by the host.
client_id: StringAzure AD application (client) ID. Required for the built-in client credentials flow. Not required when an identity provider is injected by the host.
client_secret: StringAzure AD client secret for OAuth2 client credentials flow. Required for the built-in client credentials flow. Not required when an identity provider is injected by the host.
entities: Vec<String>List of entity logical names to monitor (e.g., ["account", "contact"]).
These are the singular logical names matching the platform’s
RetrieveEntityChangesRequest.EntityName parameter.
entity_set_overrides: HashMap<String, String>Override the entity set name (Web API plural form) for specific entities. By default, entity set names are derived by appending ‘s’ to the logical name. Use this for entities with non-standard pluralization.
Example: {"activityparty": "activityparties"}
entity_columns: HashMap<String, Vec<String>>Per-entity column selection. If an entity is not in this map,
all columns are retrieved (equivalent to ColumnSet(true) in the SDK).
min_interval_ms: u64Minimum adaptive polling interval in milliseconds (default: 500).
Matches the platform’s MinIntervalMs = 500.
max_interval_seconds: u64Maximum adaptive polling interval per entity in seconds (default: 30).
This is the single-entity base value, matching the platform’s
SingleEntityMaxIntervalMs / 1000. At startup, the effective max is
scaled by sqrt(entity_count) (e.g., 1 entity → 30s, 5 → 67s, 10 → 95s).
api_version: StringDataverse Web API version (default: v9.2).
Implementations§
Source§impl DataverseSourceConfig
impl DataverseSourceConfig
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate the configuration for the built-in client credentials flow.
For Azure CLI / developer tools authentication, configure an Azure
identity provider (kind: azure, authMethod: developer_tools) and
reference it from the source — then [validate_with_identity_provider]
applies instead.
Sourcepub fn validate_with_identity_provider(&self) -> Result<(), String>
pub fn validate_with_identity_provider(&self) -> Result<(), String>
Validate config when an external identity provider handles authentication.
Only checks that environment_url and entities are set — credential
fields (tenant_id, client_id, client_secret) are not required
because the identity provider supplies tokens directly.
Sourcepub fn entity_set_name(&self, entity: &str) -> String
pub fn entity_set_name(&self, entity: &str) -> String
Get the entity set name (plural form) for a given entity logical name.
First checks entity_set_overrides, then falls back to appending ‘s’.
This mirrors how the platform’s RetrieveEntityChangesRequest uses
entity logical names but the Web API requires entity set names.
Sourcepub fn select_columns(&self, entity: &str) -> Option<String>
pub fn select_columns(&self, entity: &str) -> Option<String>
Get the $select clause for a given entity, or None for all columns.
Ensures that the primary key column ({entity}id) is always included
when a column list is configured, to keep change tracking and bootstrap
logic functional.
Trait Implementations§
Source§impl Clone for DataverseSourceConfig
impl Clone for DataverseSourceConfig
Source§fn clone(&self) -> DataverseSourceConfig
fn clone(&self) -> DataverseSourceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more