Ensure that a database table does not contain a row with the given data.

@param  string $table
@param  array  $data
@return static
354953
public function notSeeInDatabase($table, array $data)
    {
        return $this->assertInDatabase($table, $data, sprintf(
            "Found row(s) in the '%s' table that matched the attributes '%s', but did not expect to.",
            $table, json_encode($data)
        ), true);
    }
467248
public function update(array $data, $where, $table = null)
    {
        $table = ($table) ?: $this->getTable();
        $sql = $this->getSql();
        $update = $sql->update($table);

        $update->set($data)
            ->where($where);

        $statement = $sql->prepareStatementForSqlObject($update);
        $result = $statement->execute();

        return $result->getAffectedRows();
    }
1091333
public function setTable($table)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $this->table = $table;
        
        //for each row
        foreach ($this->list as $row) {
            if (!is_object($row) || !method_exists($row, __FUNCTION__)) {
                continue;
            }
            
            //let the row handle this
            $row->setTable($table);
        }
        
        return $this;
    }
1361683
public function prepareInsert($table, array $data)
    {
        $data += $this->getDefaultValues($table);
        return $this->filterValues($table, $data);
    }
599095
public function excludeTables(array $tables)
    {
        if (is_array($tables) && count($tables) > 0)
        {
            $this->excludedTables = $tables;
        }

        return $this;
    }
1070254
public function setTable(Table $table = null)
    {
        $this->table = $table;

        if ($table && !in_array($this, $table->getRows())) {
            $table->addRow($this);
        }

        return $this;
    }
1090862
public function updateTable($table, ...$tables)
    {
        $instance = $this->updateQueryInstance();

        $instance->updateQuery()->table($table, ...$tables);

        return $instance;
    }
891692
public function removeTable($table)
    {
        if ($table instanceof Table)
            $table = $table->getName();
        $this->tables->set('tables', $table, null);
        return $this;
    }
510594
protected function notSeeInDatabase($table, array $data, $connection = null)
    {
        if (is_null($this->app)) {
            return; // don't run when there is no application
        }

        $database = $this->app->make('db');

        $connection = $connection ?: $database->getDefaultConnection();

        $count = $database->connection($connection)->table($table)->where($data)->count();

        $this->assertEquals(0, $count, sprintf(
            'Found unexpected records in database table [%s] that matched attributes [%s].', $table, json_encode($data)
        ));

        return $this;
    }
867145
protected function assertDatabaseMissing($table, array $data, $connection = null)
    {
        return $this->notSeeInDatabase($table, $data, $connection);
    }
1234738
public function hasTable($table = '')
    {
        $tableName = '';

        $tableName = ($table !== '') ?
            $table : $this->tableName;

        $this->schema = "SHOW TABLES LIKE '".$tableName."'";
        $this->checkSchemaExistence = true;

        return $this;
    }
1126545
public function buildUpdateSQL($table = null, $data = array())
	{
		$sql = 'update ' . $this->parseTable($table) . ' set ';
		if(is_string($data))
		{
			$sql .= $data . ' ';
		}
		else
		{
			$data = $this->parseParams($data);
			foreach($data as $key => $value)
			{
				$sql .= $this->parseKeyword($key) . '=:' . $this->parseParamName($key) . ',';
			}
		}
		$where = $this->parseCondition(isset($this->operationOption['where']) ? $this->operationOption['where'] : '');
		if ('' !== $where)
		{
			$where = 'where ' . $where . ' ';
		}
		return substr($sql,0,-1) . ' '
				. $where
				. $this->parseOrder()
				. $this->parseLimit()
				. $this->parseLock()
				;
	}
408806
public static function table($table)
    {
        //as all calls will start with this function, first check if database connection has being established
        if(Connect::getConn()==null){
            //lets just return the object of the class in-case of connection error (developer will handle the rest)
            return new static ;
        }
        self::$table = self::sanitize($table);

        return new static;
    }
11396
public function insert($table = '', $data = array())
    {
        if (empty($data)) {
            die('数据不能为空！');
        }

        //字段名处理
        foreach ($data as $k => $v) {
            $fields[] = $k;
            $values[] = $v;
            $this->bindParam($k, $v);
        }

        //insert的sql语句处理
        $sql = 'INSERT INTO '.$table.' ( '.implode(',', $fields)
            .') VALUES (';
        foreach ($fields as $k => $v) {
            $sql.=':'.$v.',';
        }
        $sql = rtrim($sql, ',');
        $sql .= ')';
        echo '<br/>'.$sql.'<br/>';

        return $this->execute($sql);
    }
364798
public function rowsFrom(string $table, string ...$tables)
    {
        array_unshift($tables, $table);

        foreach ($tables as $table) {
            $this->rowsFrom[] = $this->dialect()->quoteName($table);
        }

        return $this;
    }
998182
public function insertRecord($table, array $data)
    {
        $dbHandle = $this->getDatabaseConnection();

        $fieldSet = array_keys($data);

        // Prepare sets
        $valueSet = array();
        foreach ($data as $key => $value) {
            $valueSet[':' . $key] = $value;
        }

        if (count($fieldSet) == 0 || count($valueSet) == 0) {
            throw new \Exception('Missing data for insert query', 1363894664);
        }

        $fieldSet[] = 'tstamp';
        $valueSet[':tstamp'] = time();

        $fieldSet[] = 'crdate';
        $valueSet[':crdate'] = time();

        $query = 'INSERT INTO ' . $table . ' (`' . implode('`,`', $fieldSet) . '`)
                  VALUES (' . implode(', ', array_keys($valueSet)) . ')';

        $statement = $dbHandle->prepare($query);
        $executeResult = $statement->execute($valueSet);

        $this->checkQueryError($statement, $executeResult, $valueSet);
        return $dbHandle->lastInsertId();
    }
131548
public function assertInDatabase($table, array $data, $message, $negate = false)
    {
        $count = $this->seeRowsWereReturned($table, $data);
        $method = $negate ? 'assertEquals' : 'assertGreaterThan';

        $this->$method(0, $count, $message);

        return $this;
    }