示例#1
0
 public TenantSchema(StoreOptions options, Tenant tenant)
 {
     _features    = options.Storage;
     _tenant      = tenant;
     StoreOptions = options;
     DdlRules     = options.Advanced.DdlRules;
 }
示例#2
0
        public Tenant(StorageFeatures features, StoreOptions options, IConnectionFactory factory, string tenantId)
        {
            TenantId  = tenantId;
            _features = features;
            _options  = options;
            _factory  = factory;

            resetSequences();
        }
示例#3
0
        public MartenDatabase(StoreOptions options, IConnectionFactory factory, string identifier)
            : base(options, options.AutoCreateSchemaObjects, options.Advanced.Migrator, identifier, factory.Create)
        {
            _features = options.Storage;
            _options  = options;

            resetSequences();

            Providers = options.Providers;
        }
示例#4
0
        public void RemoveSchemaItems(Type featureType, StorageFeatures features)
        {
            var feature = features.FindFeature(featureType);
            var writer  = new StringWriter();

            foreach (var schemaObject in feature.Objects)
            {
                schemaObject.WriteDropStatement(_options.DdlRules, writer);
            }

            _factory.RunSql(writer.ToString());
        }
示例#5
0
        public Tenant(StorageFeatures features, StoreOptions options, IConnectionFactory factory, string tenantId)
        {
            TenantId  = tenantId;
            _features = features;
            _options  = options;
            _factory  = factory;

            resetSequences();

            Providers = options.AutoCreateSchemaObjects == AutoCreate.None
                ? options.Providers
                : new StorageCheckingProviderGraph(this, options.Providers);
        }
示例#6
0
 internal void IncludeDocumentMappingBuilders(StorageFeatures includedStorage)
 {
     foreach (var builder in includedStorage._builders.Values)
     {
         if (_builders.TryGetValue(builder.DocumentType, out var existing))
         {
             existing.Include(builder);
         }
         else
         {
             _builders.Add(builder.DocumentType, builder);
         }
     }
 }
示例#7
0
        // TODO -- need to name the databases some how
        public MartenDatabase(StoreOptions options, IConnectionFactory factory, string tenantId)
            : base(options, options.AutoCreateSchemaObjects, options.Advanced.Migrator, "Marten", factory.Create)
        {
            TenantId  = tenantId;
            _features = options.Storage;
            _options  = options;
            _factory  = factory;

            resetSequences();

            Providers = options.AutoCreateSchemaObjects == AutoCreate.None
                ? options.Providers
                : new StorageCheckingProviderGraph(this, options.Providers);
        }
示例#8
0
 public TenantSchema(StoreOptions options, Tenant tenant)
 {
     _features    = options.Storage;
     _tenant      = tenant;
     StoreOptions = options;
 }