Пример #1
0
        public override async Task Between(SmugglerBetweenOptions <RavenConnectionStringOptions> betweenOptions)
        {
            SetDatabaseNameIfEmpty(betweenOptions.From);
            SetDatabaseNameIfEmpty(betweenOptions.To);

            using (var exportStore = CreateStore(betweenOptions.From))
                using (var exportBulkOperation = CreateBulkInsertOperation(exportStore))
                {
                    var exportStoreFeatures = new Reference <ServerSupportedFeatures>();
                    var exportOperations    = new SmugglerRemoteDatabaseOperations(() => exportStore, () => exportBulkOperation, () => exportStoreFeatures.Value.IsDocsStreamingSupported, () => exportStoreFeatures.Value.IsTransformersSupported, () => exportStoreFeatures.Value.IsIdentitiesSmugglingSupported);

                    exportStoreFeatures.Value = await DetectServerSupportedFeatures(exportOperations, betweenOptions.From).ConfigureAwait(false);

                    using (var importStore = CreateStore(betweenOptions.To))
                        using (var importBulkOperation = CreateBulkInsertOperation(importStore))
                        {
                            var importStoreFeatures = new Reference <ServerSupportedFeatures>();
                            var importOperations    = new SmugglerRemoteDatabaseOperations(() => importStore, () => importBulkOperation, () => importStoreFeatures.Value.IsDocsStreamingSupported, () => importStoreFeatures.Value.IsTransformersSupported, () => importStoreFeatures.Value.IsIdentitiesSmugglingSupported);

                            importStoreFeatures.Value = await DetectServerSupportedFeatures(importOperations, betweenOptions.To).ConfigureAwait(false);

                            await new SmugglerDatabaseBetweenOperation
                            {
                                OnShowProgress = betweenOptions.ReportProgress
                            }
                            .Between(new SmugglerBetweenOperations
                            {
                                From           = exportOperations,
                                To             = importOperations,
                                IncrementalKey = betweenOptions.IncrementalKey
                            }, Options)
                            .ConfigureAwait(false);
                        }
                }
        }
Пример #2
0
 public SmugglerDatabaseApi(SmugglerDatabaseOptions options = null)
     : base(options ?? new SmugglerDatabaseOptions())
 {
     Operations = new SmugglerRemoteDatabaseOperations(() => store, () => operation, () => IsDocsStreamingSupported, () => IsTransformersSupported);
 }
Пример #3
0
		public SmugglerDatabaseApi(SmugglerDatabaseOptions options = null)
			: base(options ?? new SmugglerDatabaseOptions())
		{
			Operations = new SmugglerRemoteDatabaseOperations(() => store, () => operation, () => IsDocsStreamingSupported, () => IsTransformersSupported);
		}