1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/lib/db/index.js
ivaosthu 51442a6cc4 Remove client_strategies table
We can just have a strategies column in the client_applications
table. This solves all our needs, and thus avoids the need
for an extra table.
2020-02-20 08:30:42 +01:00

27 lines
1019 B
JavaScript

'use strict';
const { createDb } = require('./db-pool');
const EventStore = require('./event-store');
const FeatureToggleStore = require('./feature-toggle-store');
const StrategyStore = require('./strategy-store');
const ClientInstanceStore = require('./client-instance-store');
const ClientMetricsDb = require('./client-metrics-db');
const ClientMetricsStore = require('./client-metrics-store');
const ClientApplicationsStore = require('./client-applications-store');
module.exports.createStores = (config) => {
const db = createDb(config);
const eventStore = new EventStore(db);
const clientMetricsDb = new ClientMetricsDb(db);
return {
db,
eventStore,
featureToggleStore: new FeatureToggleStore(db, eventStore),
strategyStore: new StrategyStore(db, eventStore),
clientApplicationsStore: new ClientApplicationsStore(db),
clientInstanceStore: new ClientInstanceStore(db),
clientMetricsStore: new ClientMetricsStore(clientMetricsDb),
};
};