         ], (err) => cb?(err))
 
     key_value_store: (opts={}) => # key_value_store(name:"the name")
-        new KeyValueStore(@, opts)
+        new KeyValueStore(@db, opts)
 
     uuid_value_store: (opts={}) => # uuid_value_store(name:"the name")
         new UUIDValueStore(@, opts)

        #TODO

class KeyValueStore
    #   c = new (require("cassandra").Salvus)(); d = c.key_value_store('test')
    #   d.set(key:[1,2], value:[465, {abc:123, xyz:[1,2]}], ttl:5)
    #   d.get(key:[1,2], console.log)   # but call it again in > 5 seconds and get nothing...
    constructor: (opts={}) ->
        @opts = defaults(opts, name:required)
        # TODO

    set: (opts={}) =>
        opts = defaults opts,
            key         : undefined
            value       : undefined
            ttl         : 0
            cb          : undefined
        # TODO

    get: (opts={}) =>
        opts = defaults opts,
            key         : undefined
            timestamp   : false      # if specified, result is {value:the_value, timestamp:the_timestamp} instead of just value.
            cb          : undefined  # cb(error, value)
        # TODO

    delete: (opts={}) ->
        opts = defaults(opts, key:undefined, cb:undefined)


TABLES = misc.split(TABLES)

PROJECT_GROUPS = misc.PROJECT_GROUPS

PROJECT_COLUMNS = exports.PROJECT_COLUMNS = ['project_id', 'account_id', 'title', 'last_edited', 'description', 'public', 'bup_location', 'size', 'deleted', 'hide_from_accounts'].concat(PROJECT_GROUPS)

