<commit_before><?php
namespace ParagonIE\EasyDB;

use \Paragonie\EasyDB\Exception as Issues;

class EasyDB
{
    protected $dbengine = null;
    protected $pdo = null;
    
    public function __construct(\PDO $pdo, $dbengine = '')
    {
        $this->pdo = $pdo;
        $this->dbengine = $driver;
    }
    
    /**
     * Fetch a column
     * 
     * @param string $statement SQL query without user data
     * @param int $offset - How many columns from the left are we grabbing from each row?
     * @params ... $params Parameters
     * @return mixed
     */
    public function column($statement, $params = [], $offset = 0)
    {
        // This array accumulates our results
        $columns = [];
        
        $stmt = $this->pdo->prepare($statement);
        $exec = $stmt->execute($params);
        if ($exec) {
            do {
                $curr = $stmt->fetchColumn($offset);
                if ($curr === false) {
                    break;
                }
                $columns[] = $curr;
            } while($curr !== false);
            return $curr;
        }
        return false;
    }
    
    /**
     * Variadic version of $this->single()
     *
     * @param string $statement SQL query without user data
     * @params mixed ...$params Parameters
     * @return mixed
     */
    public function cell($statement, ...$params)
    {
        return $this->single($statement, $params);
    }
    
    /**
     * Delete rows in a database table.<commit_msg>Thanks @DByte for the suggestion!<commit_after><?php
namespace ParagonIE\EasyDB;

use \Paragonie\EasyDB\Exception as Issues;

class EasyDB
{
    protected $dbengine = null;
    protected $pdo = null;
    
    public function __construct(\PDO $pdo, $dbengine = '')
    {
        $this->pdo = $pdo;
        $this->dbengine = $driver;
    }
    
    /**
     * Fetch a column
     * 
     * @param string $statement SQL query without user data
     * @param int $offset - How many columns from the left are we grabbing from each row?
     * @params ... $params Parameters
     * @return mixed
     */
    public function column($statement, $params = [], $offset = 0)
    {
        // This array accumulates our results
        $columns = [];
        
        $stmt = $this->pdo->prepare($statement);
        $exec = $stmt->execute($params);
        if ($exec) {
            return $stmt->fetchAll(\PDO::FETCH_ASSOC, \PDO::FETCH_COLUMN, $offset);
        }
        return false;
    }
    
    /**
     * Variadic version of $this->single()
     *
     * @param string $statement SQL query without user data
     * @params mixed ...$params Parameters
     * @return mixed
     */
    public function cell($statement, ...$params)
    {
        return $this->single($statement, $params);
    }
    
    /**
     * Delete rows in a database table.
{'fraction_non_alphanumeric': 0.12932862190812722, 'fraction_numerical': 0.0007067137809187279, 'mean_word_length': 1.8423694779116466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3253434', 'n_tokens_mistral': 826, 'n_tokens_neox': 807, 'n_words': 232}