/// <summary> /// Creates a new DocumentStore with the supplied StoreOptions /// </summary> /// <param name="options"></param> public DocumentStore(StoreOptions options) { options.CreatePatching(); _options = options; _connectionFactory = options.ConnectionFactory(); _logger = options.Logger(); Schema = new DocumentSchema(_options, _connectionFactory, _logger); _serializer = options.Serializer(); var cleaner = new DocumentCleaner(_connectionFactory, Schema.As <DocumentSchema>()); Advanced = new AdvancedOptions(cleaner, options, _serializer, Schema); Diagnostics = new Diagnostics(Schema); CreateDatabaseObjects(); Transform = new DocumentTransforms(this, _connectionFactory); options.InitialData.Each(x => x.Populate(this)); if (options.AutoCreateSchemaObjects != AutoCreate.None) { Schema.As <DocumentSchema>().RebuildSystemFunctions(); } }
/// <summary> /// Creates a new DocumentStore with the supplied StoreOptions /// </summary> /// <param name="options"></param> public DocumentStore(StoreOptions options) { _options = options; _connectionFactory = options.ConnectionFactory(); _runner = new ManagedConnection(_connectionFactory, CommandRunnerMode.ReadOnly); _logger = options.Logger(); var creation = options.AutoCreateSchemaObjects ? (IDocumentSchemaCreation) new DevelopmentSchemaCreation(_connectionFactory, _logger) : new ProductionSchemaCreation(); Schema = new DocumentSchema(_options, _connectionFactory, creation); Schema.Alter(options.Schema); _serializer = options.Serializer(); var cleaner = new DocumentCleaner(_connectionFactory, Schema); Advanced = new AdvancedOptions(cleaner, options); Diagnostics = new Diagnostics(Schema, new MartenQueryExecutor(_runner, Schema, _serializer, _parser, new NulloIdentityMap(_serializer))); EventStore = new EventStoreAdmin(_connectionFactory, _options, creation, _serializer); }
/// <summary> /// Creates a new DocumentStore with the supplied StoreOptions /// </summary> /// <param name="options"></param> public DocumentStore(StoreOptions options) { _options = options; _runner = new CommandRunner(options.ConnectionFactory()); var creation = options.AutoCreateSchemaObjects ? (IDocumentSchemaCreation) new DevelopmentSchemaCreation(_runner) : new ProductionSchemaCreation(); Schema = new DocumentSchema(_options, _runner, creation); Schema.Alter(options.Schema); _serializer = options.Serializer(); var cleaner = new DocumentCleaner(_runner, Schema); Advanced = new AdvancedOptions(cleaner, options); Diagnostics = new Diagnostics(Schema, new MartenQueryExecutor(_runner, Schema, _serializer, _parser, new NulloIdentityMap(_serializer))); if (options.RequestCounterThreshold.HasThreshold) { _runnerForSession = () => new RequestCounter(_runner, options.RequestCounterThreshold); } else { _runnerForSession = () => _runner; } }
/// <summary> /// Creates a new DocumentStore with the supplied StoreOptions /// </summary> /// <param name="options"></param> public DocumentStore(StoreOptions options) { _options = options; _connectionFactory = options.ConnectionFactory(); _logger = options.Logger(); Schema = new DocumentSchema(_options, _connectionFactory, _logger); _serializer = options.Serializer(); var cleaner = new DocumentCleaner(_connectionFactory, Schema.As <DocumentSchema>()); Advanced = new AdvancedOptions(cleaner, options, _serializer, Schema); Diagnostics = new Diagnostics(Schema); CreateDatabaseObjects(); Transform = new DocumentTransforms(this); options.InitialData.Each(x => x.Populate(this)); }
/// <summary> /// Creates a new DocumentStore with the supplied StoreOptions /// </summary> /// <param name="options"></param> public DocumentStore(StoreOptions options) { _options = options; _connectionFactory = options.ConnectionFactory(); _logger = options.Logger(); Schema = new DocumentSchema(_options, _connectionFactory, _logger); _serializer = options.Serializer(); var cleaner = new DocumentCleaner(_connectionFactory, Schema.As <DocumentSchema>()); Advanced = new AdvancedOptions(cleaner, options, _serializer, Schema); Diagnostics = new Diagnostics(Schema); EventStore = new EventStoreAdmin(Schema, _connectionFactory, _options, _serializer); CreateDatabaseObjects(); }