Beispiel #1
0
        public static void ShouldContainIndexDefinitionFor <TDocument>(
            this StorageFeatures storage,
            string tableName  = "fulltext.mt_doc_target",
            string indexName  = "mt_doc_target_idx_fts",
            string regConfig  = "english",
            string dataConfig = null)
        {
            var documentMapping = storage.MappingFor(typeof(TDocument));
            var table           = new DocumentTable(documentMapping);
            var ddl             = documentMapping.Indexes
                                  .Where(x => x.Name == indexName)
                                  .Select(x => x.ToDDL(table))
                                  .FirstOrDefault();

            ddl.ShouldNotBeNull();

            SpecificationExtensions.ShouldContain(ddl, $"CREATE INDEX {indexName}");
            SpecificationExtensions.ShouldContain(ddl, $"ON {tableName}");
            SpecificationExtensions.ShouldContain(ddl, $"to_tsvector('{regConfig}',{dataConfig})");

            if (regConfig != null)
            {
                SpecificationExtensions.ShouldContain(ddl, regConfig);
            }

            if (dataConfig != null)
            {
                SpecificationExtensions.ShouldContain(ddl, dataConfig);
            }
        }
Beispiel #2
0
 public StoreOptions()
 {
     Events     = new EventGraph(this);
     Schema     = new MartenRegistry();
     Transforms = new Transforms.Transforms(this);
     Storage    = new StorageFeatures(this);
 }
Beispiel #3
0
 public MorePageViewModel(INavigation navigation, IUserDialogs userDialogs) : base(navigation, userDialogs)
 {
     StorageFeatures.AddRange(new[]
     {
         new MenuItem {
             Name = "Files", Icon = "tab_feed.png", Parameter = "files"
         },
         new MenuItem {
             Name = "Subscriptions", Icon = "tab_feed.png", Parameter = "subscriptions"
         },
     });
     SettingsItems.AddRange(new[]
     {
         new MenuItem {
             Name = "About", Icon = "tab_feed.png", Parameter = "about"
         },
         new MenuItem {
             Name = "Log Out", Icon = "tab_feed.png", Parameter = "logout"
         },
         new MenuItem {
             Name = "Delete Local Blobs", Icon = "tab_feed.png", Parameter = "deletelocalblobs"
         },
     });
     signOnClient = DependencyService.Get <ISignOnClient>();
 }
        public static void ShouldContainIndexDefinitionFor <TDocument>(
            this StorageFeatures storage,
            string tableName  = "public.mt_doc_target",
            string indexName  = "mt_doc_target_idx_fts",
            string regConfig  = "english",
            string dataConfig = null)
        {
            var ddl = storage.MappingFor(typeof(TDocument)).Indexes
                      .Where(x => x.IndexName == indexName)
                      .Select(x => x.ToDDL())
                      .FirstOrDefault();

            ddl.ShouldNotBeNull();

            ddl.ShouldContain($"CREATE INDEX {indexName}");
            ddl.ShouldContain($"ON {tableName}");
            ddl.ShouldContain($"to_tsvector('{regConfig}', {dataConfig})");

            if (regConfig != null)
            {
                ddl.ShouldContain(regConfig);
            }

            if (dataConfig != null)
            {
                ddl.ShouldContain(dataConfig);
            }
        }
Beispiel #5
0
        public IncludeSelector(StorageFeatures storage, ISelector <T> inner, IIncludeJoin[] joins)
        {
            _joins = joins;
            var selector = inner;

            joins.Each(x => selector = x.WrapSelector(storage, selector));

            _inner = selector;
        }
        public MartenRegistryTests()
        {
            var storeOptions = new StoreOptions();

            storeOptions.Schema.Include <TestRegistry>();

            var store = TestingDocumentStore.For(_ => _.Schema.Include <TestRegistry>());

            theStorage = store.Storage;
        }
Beispiel #7
0
        public MartenRegistryTests() : base("registry")
        {
            var store = SeparateStore(_ =>
            {
                _.Schema.For <Organization>()
                .Duplicate(x => x.Name).Duplicate(x => x.OtherName, configure: x =>
                {
                    x.Name = "mt_special";
                })
                .GinIndexJsonData(x => x.Name          = "my_gin_index")
                .IndexLastModified(x => x.IsConcurrent = true)
                .SoftDeletedWithIndex(x => x.Method    = IndexMethod.brin);

                _.Schema.For <User>().PropertySearching(PropertySearching.JSON_Locator_Only);
            });

            theStorage = store.Storage;
        }
Beispiel #8
0
        public DocumentStore(StoreOptions options)
        {
            options.ApplyConfiguration();
            options.Validate();

            Options    = options;
            _logger    = options.Logger();
            Serializer = options.Serializer();


            // Workaround to make database creation lazy so all StoreOptions
            // customizations can be done first
            if (Tenancy is DefaultTenancy d)
            {
                d.Initialize();
            }

            if (options.CreateDatabases != null)
            {
                IDatabaseGenerator databaseGenerator = new DatabaseGenerator();
                databaseGenerator.CreateDatabases(Tenancy, options.CreateDatabases);
            }

            StorageFeatures.PostProcessConfiguration();
            Events.AssertValidity(this);
            Options.Projections.AssertValidity(this);

            Advanced = new AdvancedOperations(this);

            Diagnostics = new Diagnostics(this);

            _lightweightCompiledQueries  = new CompiledQueryCollection(DocumentTracking.None, this);
            _identityMapCompiledQueries  = new CompiledQueryCollection(DocumentTracking.IdentityOnly, this);
            _dirtyTrackedCompiledQueries = new CompiledQueryCollection(DocumentTracking.DirtyTracking, this);
            _queryOnlyCompiledQueries    = new CompiledQueryCollection(DocumentTracking.QueryOnly, this);
        }
Beispiel #9
0
 public DbObjects(ITenant tenant, StorageFeatures features)
 {
     _tenant   = tenant;
     _features = features;
 }
 public DictionaryIncludeCallbackResolver(ICompiledQuery <TDoc, TOut> query, IncludeResultOperator includeOperator, StorageFeatures storage)
 {
     _query           = query;
     _includeOperator = includeOperator;
     _storage         = storage;
 }
Beispiel #11
0
        public MartenRegistryTests() : base("registry")
        {
            var store = SeparateStore(_ => _.Schema.Include <TestRegistry>());

            theStorage = store.Storage;
        }
Beispiel #12
0
 public ISelector <TSearched> WrapSelector <TSearched>(StorageFeatures storage, ISelector <TSearched> inner)
 {
     return(new IncludeSelector <TSearched, T>(TableAlias, _mapping, _callback, inner, storage.StorageFor(typeof(T)).As <IDocumentStorage <T> >()));
 }
Beispiel #13
0
 public CompiledIncludeJoinBuilder(StorageFeatures storage)
 {
     _storage = storage;
 }