コード例 #1
0
        public ISequence Hilo(Type documentType, HiloSettings settings)
        {
            // TODO -- here, need to see if the mt_hilo table is created, and if not,
            // do it through _creation.

            if (!_schema.SchemaTableNames().Contains("mt_hilo"))
            {
                _creation.RunScript("mt_hilo");
            }

            return(new HiloSequence(_factory, documentType.Name, settings));
        }
コード例 #2
0
        public void CompletelyRemoveAll()
        {
            using (var connection = new ManagedConnection(_factory, CommandRunnerMode.ReadOnly))
            {
                _schema.SchemaTableNames()
                .Each(tableName => { connection.Execute($"DROP TABLE IF EXISTS {tableName} CASCADE;"); });


                var drops = connection.GetStringList(DropAllFunctionSql);
                drops.Each(drop => connection.Execute(drop));
            }
        }
コード例 #3
0
        public void CompletelyRemoveAll()
        {
            _schema.SchemaTableNames().Each(dropTable);

            dropFunctions(_dropAllFunctionSql);
        }
コード例 #4
0
ファイル: EventGraph.cs プロジェクト: uknickwilliams/marten
        public bool ShouldRegenerate(IDocumentSchema schema)
        {
            var documentTables = schema.SchemaTableNames().ToArray();

            return(!documentTables.Contains("mt_streams"));
        }
コード例 #5
0
ファイル: DocumentSchemaTests.cs プロジェクト: nieve/marten
        public DocumentSchemaWithOverridenDefaultSchemaAndEventsTests()
        {
            StoreOptions(options =>
            {
                options.DatabaseSchemaName = "other";
                options.MappingFor(typeof(User)).DatabaseSchemaName = "yet_another";
                options.MappingFor(typeof(Issue)).DatabaseSchemaName = "overriden";
                options.MappingFor(typeof(Company));
                options.Events.AddEventType(typeof(MembersJoined));
            });

            _schema = theStore.Schema;

            _sql = _schema.ToDDL();

            using (var session = theStore.OpenSession())
            {
                session.Store(new User());
                session.Store(new Issue());
                session.Store(new Company());
                session.SaveChanges();
            }

            _tables = _schema.SchemaTableNames();
            _functions = _schema.SchemaFunctionNames();
        }
コード例 #6
0
ファイル: DocumentSchemaTests.cs プロジェクト: nieve/marten
        public DocumentSchemaWithOverridenSchemaTests()
        {
            StoreOptions(_ =>
            {
                _.MappingFor(typeof(User)).DatabaseSchemaName = "other";
                _.MappingFor(typeof(Issue)).DatabaseSchemaName = "overriden";
                _.MappingFor(typeof(Company));

                _.DatabaseSchemaName = Marten.StoreOptions.DefaultDatabaseSchemaName;
            });

            _schema = theStore.Schema;
            _sql = _schema.ToDDL();

            using (var session = theStore.OpenSession())
            {
                session.Store(new User());
                session.Store(new Issue());
                session.Store(new Company());
                session.SaveChanges();
            }

            _tables = _schema.SchemaTableNames();
            _functions = _schema.SchemaFunctionNames();
        }