lib/knex-backend.js
function(bucket, key, cb){
		contract(arguments)
			.params('string', 'string|number', 'function')
			.end()
		;
		
		var table = '';
		if (bucket.indexOf('allows') != -1) {
			table = this.prefix + this.buckets.permissions;
			this.db
				.select('key', 'value')
				.from(table)
				.where({'key': bucket})
				.then(function(result) {
					if (result.length) {
						cb(undefined, (result[0].value[key] ? result[0].value[key] : []));
					} else {
						cb(undefined, []);
					}
				})
			;
		} else {
			table = this.prefix + bucket;
			this.db
				.select('key', 'value')
				.from(table)
				.where({'key': key})
				.then(function(result) {
					cb(undefined, (result.length ? result[0].value : []));
				})
			;
		}
	}
function(bucket, key, cb){
		contract(arguments)
			.params('string', 'string|number', 'function')
			.end()
		;
		
		var table = '';
		if (bucket.indexOf('allows') != -1) {
			table = this.prefix + this.buckets.permissions;
			this.db
				.select('key', 'value')
				.from(table)
				.where({'key': bucket})
				.then(function(result) {
					if (result.length) {
						cb(undefined, (result[0].value[key] ? result[0].value[key] : []));
					} else {
						cb(undefined, []);
					}
				})
			;
		} else {
			table = this.prefix + bucket;
			this.db
				.select('key', 'value')
				.from(table)
				.where({'key': key})
				.then(function(result) {
					cb(undefined, (result.length ? result[0].value : []));
				})
			;
		}
	}
function ( bucket , key , cb ) { contract ( arguments ) . params ( 'string' , 'string|number' , 'function' ) . end ( ) ; var table = '' ; if ( bucket . indexOf ( 'allows' ) != - 1 ) { table = this . prefix + this . buckets . permissions ; this . db . select ( 'key' , 'value' ) . from ( table ) . where ( { 'key' : bucket } ) . then ( function ( result ) { if ( result . length ) { cb ( undefined , ( result [ 0 ] . value [ key ] ? result [ 0 ] . value [ key ] : [ ] ) ) ; } else { cb ( undefined , [ ] ) ; } } ) ; } else { table = this . prefix + bucket ; this . db . select ( 'key' , 'value' ) . from ( table ) . where ( { 'key' : key } ) . then ( function ( result ) { cb ( undefined , ( result . length ? result [ 0 ] . value : [ ] ) ) ; } ) ; } }
Gets the contents at the bucket's key.
Gets the contents at the bucket s key .