예제 #1
0
        public void RebuildEventStoreSchema()
        {
            _creation.RunScript("mt_stream");
            _creation.RunScript("mt_initialize_projections");
            _creation.RunScript("mt_apply_transform");
            _creation.RunScript("mt_apply_aggregation");

            var js = SchemaBuilder.GetJavascript("mt_transforms");

            _runner.Execute(conn =>
            {
                conn.CreateCommand("insert into mt_modules (name, definition) values (:name, :definition)")
                .With("name", "mt_transforms")
                .With("definition", js)
                .ExecuteNonQuery();
            });
        }
예제 #2
0
        public void RebuildEventStoreSchema()
        {
            _creation.RunScript("mt_stream");
            _creation.RunScript("mt_initialize_projections");
            _creation.RunScript("mt_apply_transform");
            _creation.RunScript("mt_apply_aggregation");

            var js = SchemaBuilder.GetJavascript("mt_transforms");

            using (var connection = new ManagedConnection(_connectionFactory))
            {
                connection.Execute(cmd =>
                {
                    cmd.WithText("insert into mt_modules (name, definition) values (:name, :definition)")
                    .With("name", "mt_transforms")
                    .With("definition", js)
                    .ExecuteNonQuery();
                });
            }
        }
예제 #3
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));
        }