Sends a request to create/insert data.
@param mixed $table entity to create
@param mixed $columns attributes of object to create
@param array $params request parameters
@return $this
18761
public function insert($table, $columns, array $params = [])
    {
        $request = $this->db->getQueryBuilder()->insert($table, $columns, $params);

        return $this->setRequest($request);
    }
220597
public function select($column, ...$columns) {
        $this->params = [];
        if (count($columns)) {
            array_unshift($columns, $column);
            $columnStr = implode('`,`', $columns);
            $this->sql = "SELECT `{$columnStr}` ";
        } else {
            $this->sql = "SELECT {$column} ";
        }
        return $this;
    }
900883
public function insert($columns) {
        // Check if array is associative
        if (Arr::is_assoc($columns)) {
            // Get array keys
            $arr_keys = array_keys($columns);

            // Get array values
            $arr_values = array_values($columns);

            $values = '';
            $fields = '';
            $insert  = [];

            // Build up the insert query
            $this->q->apd('INSERT INTO ' . $this->table_name . '(');

            for ($ii = 0; $ii < count($arr_keys); $ii++) {
                if ($ii != count($arr_keys) -1) {
                    $fields .= $arr_keys[$ii] . ', ';

                    if (!$this->is_SQL_function($arr_values[$ii])) {
                        $values .= ':' . $arr_keys[$ii] . ', ';
                        $insert[':' . $arr_keys[$ii]] = $arr_values[$ii];
                    } else {
                        $values .= $arr_values[$ii] . ', ';
                    }
                } else {
                    $fields .= $arr_keys[$ii] . ') VALUES (';

                    if (!$this->is_SQL_function($arr_values[$ii])) {
                        $values .= ':' . $arr_keys[$ii] . ')';
                        $insert[':' . $arr_keys[$ii]] = $arr_values[$ii];
                    } else {
                        $values .= $arr_values[$ii] . ')';
                    }
                }
            }

            // Finalize query
            $this->q->apd($fields . $values);

            try {
                $query = $this->db->prepare($this->q->get());
                $query->execute($insert);
                $this->clear();

                // Set last inserted id
                $this->lastInsertId = $this->db->lastInsertId();

                return true;
            } catch (\PDOException $e) {
                $this->setError('d', $e->getMessage());
                return false;
            }
        } else {
            echo 'Wrong array format';
            return false;
        }
    }
996199
public function insert(string $table) : QueryBuilder
    {
        $this->_query[] = "INSERT INTO";
        $this->_query[] = "`". $this->sanitize($table) ."`";

        return $this;
    }
588479
public function insert($table, array $columns)
    {
        if (empty($columns)) {
            return 0;
        }
        return $this->getInsertBuilder()
            ->setTable($table)
            ->setColumns($columns)
            ->execute();
    }
907707
protected function getCreateColumnCommentsSQLQueries(array $columns, $table)
    {
        $queries = array();

        foreach ($columns as $column) {
            if ($this->hasCustomType($column->getType()->getName()) || ($column->getComment() !== null)) {
                $queries[] = $this->getCreateColumnCommentSQLQuery($column, $table);
            }
        }

        return $queries;
    }
608232
private function createIndex(Table $table, array $columns)
    {
        if (count($columns) > 0) {
            $indexPrefix = "idx_" . RdsDeliveryExecutionService::TABLE_NAME . "_";

            // Index names are limited to 63 characters in PostgreSQL (64 in MySQL)
            $indexName = substr($indexPrefix . implode("_", $columns), 0, 63);

            $table->addIndex($columns, $indexName);
        }
    }
372978
public function order($columns)
  {
    if ( is_null($this->order) ){
      $this->order = new Element('ORDER BY', $columns);
    }
    else {
      $this->order->append($columns);
    }
    
    return $this;
  }
897998
public static function create($table,$data)
    {
        $column='';
        $values='';
        $ends=count($data)-1;
        $n=0;
        foreach ($data as $key=>$value) {
            $column.="`{$key}`";
            $values.=":{$key}";
            if($n!=$ends){
                $column.=',';
                $values.=',';
            }
            $n++;
        }
        $sql=sprintf('INSERT INTO `:%s` (%s) VALUES (%s)',$table,$column,$values);
        return self::execute($sql,$data);
    }
579848
public function insert($table, $data, $statements)
    {
        $input = [
            'columns' => '',
            'values' => ''
        ];

        $query = 'INSERT INTO `' . $table . '` ';

        foreach ($data as $column => $value) {
            $input['columns'] .= $column . ', ';

            $value = (is_null($statements) && is_string($value)) ? "'$value'" : $value;

            $input['values'] .= $value . ', ';
        }

        $query .= '(' . rtrim(trim($input['columns']), ',') . ') ';

        $query .= 'VALUES (' . rtrim(trim($input['values']), ',') . ')';

        return $this->query($query, 'INSERT');
    }
1367788
public function create($columns, $options='charset=utf8 engine=innodb')
    {
        $columnSql = array();
        $platform = $this->_connection->platform();

        foreach($columns as $name=>$type)
            $columnSql []= $type->columnSql($name, $platform);

        $sql = sprintf('CREATE TABLE %s (%s) %s',
            $this->_name->quoted(),
            implode(', ', $columnSql),
            $options
        );

        $this->_connection->execute($sql);
    }
686658
public function sqlFetchColumn(string $sql, array $params = [], string $column = '0')
    {
        return $this->connection()->sqlFetchColumn($sql, $params, $column);
    }
1248511
public function columns($columns)
    {
        if (is_null($this->columns)) {
            $this->columns = $this->element('()', $columns);
        } else {
            $this->columns->append($columns);
        }

        return $this;
    }
1256512
public function bindColumn($column, &$param, $type = null)
    {
        if ($type === null) :
            $this->_statement->bindColumn($column, $param);
        else :
            $this->_statement->bindColumn($column, $param, $type);
        endif;
    }
543244
public function insert($table, array $updateFields)
    {
        $this->queryTypeProcess(self::QUERYTYPE_INSERT, $table, $updateFields);
        //$this->fields = $updateFields;
        return $this;
    }
781137
public function setColumns(array $columns)
    {
        foreach ($columns as $column) {
            $this->columns->push($column);
        }

        return $this;
    }
57260
public function insertMany($table, array $columns, array $values)
    {
        $collection = array();

        foreach ($values as $index => $data) {
            foreach ($data as $key) {
                $collection[$index][] = $this->createUniqPlaceholder($key);
            }
        }

        $this->queryBuilder->insertMany($table, $columns, $collection);
        return $this;
    }