0.6.14 • Published 1 year ago

relational-redis-store v0.6.14

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

relational-redis-store

Fully Typed Relational Redis store that supports Foreign Keys, Indexes. This allows queries to combine multiple records into the result out of the box.

Usage

import * as redisSDK from 'handy-redis';
import Store from 'relational-redis-store';

type User = {
  id: string;
  name: string;
}

type Game = {
  id: string;
  players: [User[id], User[id]];
  winner?: User[id];
}

type CollectionMap = {
  users: User;
  games: Game;
};

const store = new Store<CollectionMap>(redisSDK.createHandyClient({
  url: {REDIS_URL},
}))

// Create a Game

store.addItemToCollection('games', {
  players: ['a', 'b'],
}, id, {
  foreignKeys: {},
});

// Retrieve a Game

store.getItemInCollection('games', id);

To Do

  • Atomicity
  • Transactions
0.6.12

1 year ago

0.6.14

1 year ago

0.6.11

1 year ago

0.6.9

1 year ago

0.6.8

1 year ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.1.1

1 year ago