0.0.5 • Published 4 months ago

gadb v0.0.5

Weekly downloads
-
License
AGPL-3.0
Repository
-
Last release
4 months ago

gadb is an ephemeral-database used with gaql. It provides database and table-related queries that follow the behaviour of RethinkDB's rethinkdb-ts.

npm agpl

import gaql from 'gaql'
import * as queriescore from 'gaql/src/queries/core.js'
import * as queriesdb from 'gadb/src/queries/db.js'

const q = await gaql([
  queriescore,
  queriesdb
]).dbconnect([
  ['Users',
    { id: 'userId-1234', name: 'fred' },
    { id: 'userId-5678', name: 'jane' }],
  ['Rooms', [{ primaryKey: 'room_id' }],
    { room_id: 'roomId-1234', name: 'the room' }],
  ['Memberships', {
    user_id: 'userId-1234',
    room_membership_type: 'INVITE',
    user_sender_id: 'userId-5678',
    room_id: 'roomId-1234'
  }]
])

await q.table('Memberships').indexCreate('user_id').run()

console.log(await q
  .table('Memberships')
  .getAll('userId-1234', { index: 'user_id' })
  .eqJoin('room_id', q.table('Rooms'))('right')
  .run())
// [{ room_id: 'roomId-1234', name: 'the room' }]
0.0.5

4 months ago

0.0.4

5 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago