コード例 #1
0
 public function testBlueprintSchemaBuild()
 {
     $schema = $this->connection->getSchemaBuilder();
     $schema->create('sample', function (\Ytake\LaravelCouchbase\Schema\Blueprint $blueprint) {
         $blueprint->primaryIndex();
         $blueprint->index(["message"], "secondary");
     });
     $this->assertCount(0, $this->connection->table('sample')->get());
     $this->removeBucket($this->connection->manager(), 'sample');
     sleep(5);
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 protected function pushToDatabase($delay, $queue, $payload, $attempts = 0)
 {
     $attributes = $this->buildDatabaseRecord($this->getQueue($queue), $payload, $this->getAvailableAt($delay), $attempts);
     $increment = $this->incrementKey();
     $attributes['id'] = $increment;
     $result = $this->database->table($this->table)->key($this->uniqueKey($attributes))->insert($attributes);
     if ($result) {
         return $increment;
     }
     return false;
 }