Exemplo n.º 1
0
        public async Task <IStreamStore> GetStreamStore(string schema)
        {
            var settings = new MsSqlStreamStoreSettings(ConnectionString)
            {
                Schema    = schema,
                GetUtcNow = () => GetUtcNow()
            };
            var store = new MsSqlStreamStore(settings);
            await store.CreateSchema();

            return(store);
        }
Exemplo n.º 2
0
        public async Task <MsSqlStreamStore> GetMsSqlStreamStore()
        {
            await CreateDatabase();

            var settings = new MsSqlStreamStoreSettings(ConnectionString)
            {
                Schema    = _schema,
                GetUtcNow = () => GetUtcNow()
            };

            var store = new MsSqlStreamStore(settings);
            await store.CreateSchema();

            return(store);
        }
Exemplo n.º 3
0
        public override async Task <IStreamStore> GetStreamStore()
        {
            await CreateDatabase();

            var settings = new MsSqlStreamStoreSettings(ConnectionString)
            {
                Schema    = _schema,
                GetUtcNow = () => GetUtcNow()
            };
            var store = new MsSqlStreamStore(settings);
            await store.DropAll(ignoreErrors : true);

            await store.CreateSchema();

            return(store);
        }
Exemplo n.º 4
0
        public async Task <IStreamStore> GetStreamStore(string schema = "es")
        {
            try
            {
                await CreateDatabase();
            }
            catch (SqlException e) when(e.Number == 1801)
            {
                //for testing, db exists, just ctn
            }

            var settings = new MsSqlStreamStoreSettings(ConnectionString)
            {
                Schema    = schema,
                GetUtcNow = () => GetUtcNow(),
            };
            var store = new SqlStreamStore.MsSqlStreamStore(settings);
            await store.CreateSchema();

            return(store);
        }
        private async Task Init(bool createV1Schema = false)
        {
            await _databaseInstance.CreateDatabase();

            var settings = new MsSqlStreamStoreSettings(ConnectionString)
            {
                Schema    = _schema,
                GetUtcNow = () => GetUtcNow(),
            };

            Store = new MsSqlStreamStore(settings);
            if (_createSchema)
            {
                if (createV1Schema)
                {
                    await Store.CreateSchema_v1_ForTests();
                }
                else
                {
                    await Store.CreateSchema();
                }
            }
        }