UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

28 lines 812 B
export class UniqueConnectionStore { constructor(db) { this.db = db; } async insert(uniqueConnections) { await this.db('unique_connections') .insert({ id: uniqueConnections.id, hll: uniqueConnections.hll, updated_at: this.db.raw('DEFAULT'), }) .onConflict('id') .merge(); } async get(id) { const row = await this.db('unique_connections') .select('id', 'hll', 'updated_at') .where('id', id) .first(); return row ? { id: row.id, hll: row.hll, updatedAt: row.updated_at } : null; } async deleteAll() { await this.db('unique_connections').delete(); } } //# sourceMappingURL=unique-connection-store.js.map