<commit_before><?php

/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\db\pgsql;

use yii\db\TableSchema;
use yii\db\ColumnSchema;

/**
 * Schema is the class for retrieving metadata from a PostgreSQL database 
 * (version 9.x and above).
 *
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class Schema extends \yii\db\Schema
{

	/**
	 * The default schema used for the current session. This value is 
	 * automatically set to "public" by the PDO driver. 
	 * @var string 
	 */
	public static $DEFAULT_SCHEMA;

	/**
	 * @var array mapping from physical column types (keys) to abstract 
	 * column types (values)
	 */
	public $typeMap = array(
	    'abstime' => self::TYPE_TIMESTAMP,
	    'bit' => self::TYPE_STRING,
	    'boolean' => self::TYPE_BOOLEAN,
	    'box' => self::TYPE_STRING,
	    'character' => self::TYPE_STRING,
	    'bytea' => self::TYPE_BINARY,
	    'char' => self::TYPE_STRING,
	    'cidr' => self::TYPE_STRING,
	    'circle' => self::TYPE_STRING,
	    'date' => self::TYPE_DATE,
	    'real' => self::TYPE_FLOAT,
	    'double precision' => self::TYPE_DECIMAL,
	    'inet' => self::TYPE_STRING,
	    'smallint' => self::TYPE_SMALLINT,
	    'integer' => self::TYPE_INTEGER,
	    'bigint' => self::TYPE_BIGINT,
	    'interval' => self::TYPE_STRING,
	    'json' => self::TYPE_STRING,
	    'line' => self::TYPE_STRING,
	    'macaddr' => self::TYPE_STRING,
	    'money' => self::TYPE_MONEY,
	    'name' => self::TYPE_STRING,
	    'numeric' => self::TYPE_STRING,
	    'numrange' => self::TYPE_DECIMAL,
	    'oid' => self::TYPE_BIGINT, // should not be used. it's pg internal!
	    'path' => self::TYPE_STRING,
	    'point' => self::TYPE_STRING,
	    'polygon' => self::TYPE_STRING,
	    'text' => self::TYPE_TEXT,
	    'time without time zone' => self::TYPE_TIME,
	    'timestamp without time zone' => self::TYPE_TIMESTAMP,
	    'timestamp with time zone' => self::TYPE_TIMESTAMP,
	    'time with time zone' => self::TYPE_TIMESTAMP,
	    'unknown' => self::TYPE_STRING,
	    'uuid' => self::TYPE_STRING,
	    'bit varying' => self::TYPE_STRING,
	    'character varying' => self::TYPE_STRING,
	    'xml' => self::TYPE_STRING

		/*
		 * 	internal PG types
		 *  'aclitem' => self::TYPE_STRING,	    
		 *  'cid' => self::TYPE_STRING,
		 *  'daterange' => self::TYPE_STRING,
		 *  'gtsvector' => self::TYPE_STRING,
		 *  'int4range' => self::TYPE_STRING, //unknown
		 *  'lseg' => self::TYPE_STRING,
		 *  'int8range' => self::TYPE_STRING, // unknown
		 *  'pg_node_tree' => self::TYPE_STRING,
		 *  'refcursor' => self::TYPE_STRING,
		 *  'regclass' => self::TYPE_STRING,
		 *  'regconfig' => self::TYPE_STRING,
		 *  'regdictionary' => self::TYPE_STRING,
		 *  'regoper' => self::TYPE_STRING,
		 *  'regoperator' => self::TYPE_STRING,
		 *  'regproc' => self::TYPE_STRING,
		 *  'regprocedure' => self::TYPE_STRING,
		 *  'regtype' => self::TYPE_STRING,
		 *  'reltime' => self::TYPE_STRING,
		 *  'smgr' => self::TYPE_STRING,
		 *  'tid' => self::TYPE_STRING,
		 *  'xid' => self::TYPE_STRING,
		 *  'tinterval' => self::TYPE_STRING,
		 *  'tsquery' => self::TYPE_STRING,
		 *  'tsrange' => self::TYPE_STRING,
		 *  'tstzrange' => self::TYPE_STRING,
		 *  'tsvector' => self::TYPE_STRING,
		 *  'txid_snapshot' => self::TYPE_STRING
		 */
	);

	/**
	 * Creates a query builder for the MySQL database.
	 * @return QueryBuilder query builder instance
	 */
	public function createQueryBuilder() {
		return new QueryBuilder($this->db);
	}

	/**
	 * Resolves the table name and schema name (if any).
	 * @param TableSchema $table the table metadata object
	 * @param string $name the table name
	 */
	protected function resolveTableNames($table, $name) {
		$parts = explode('.', str_replace('"', '', $name));
		if (isset($parts[1])) {
			$table->schemaName = $parts[0];
			$table->name = $parts[1];<commit_msg>Removed commented and unused pgsql datatype mappings.<commit_after><?php

/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\db\pgsql;

use yii\db\TableSchema;
use yii\db\ColumnSchema;

/**
 * Schema is the class for retrieving metadata from a PostgreSQL database 
 * (version 9.x and above).
 *
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class Schema extends \yii\db\Schema
{

	/**
	 * The default schema used for the current session. This value is 
	 * automatically set to "public" by the PDO driver. 
	 * @var string 
	 */
	public static $DEFAULT_SCHEMA;

	/**
	 * @var array mapping from physical column types (keys) to abstract 
	 * column types (values)
	 */
	public $typeMap = array(
	    'abstime' => self::TYPE_TIMESTAMP,
	    'bit' => self::TYPE_STRING,
	    'boolean' => self::TYPE_BOOLEAN,
	    'box' => self::TYPE_STRING,
	    'character' => self::TYPE_STRING,
	    'bytea' => self::TYPE_BINARY,
	    'char' => self::TYPE_STRING,
	    'cidr' => self::TYPE_STRING,
	    'circle' => self::TYPE_STRING,
	    'date' => self::TYPE_DATE,
	    'real' => self::TYPE_FLOAT,
	    'double precision' => self::TYPE_DECIMAL,
	    'inet' => self::TYPE_STRING,
	    'smallint' => self::TYPE_SMALLINT,
	    'integer' => self::TYPE_INTEGER,
	    'bigint' => self::TYPE_BIGINT,
	    'interval' => self::TYPE_STRING,
	    'json' => self::TYPE_STRING,
	    'line' => self::TYPE_STRING,
	    'macaddr' => self::TYPE_STRING,
	    'money' => self::TYPE_MONEY,
	    'name' => self::TYPE_STRING,
	    'numeric' => self::TYPE_STRING,
	    'numrange' => self::TYPE_DECIMAL,
	    'oid' => self::TYPE_BIGINT, // should not be used. it's pg internal!
	    'path' => self::TYPE_STRING,
	    'point' => self::TYPE_STRING,
	    'polygon' => self::TYPE_STRING,
	    'text' => self::TYPE_TEXT,
	    'time without time zone' => self::TYPE_TIME,
	    'timestamp without time zone' => self::TYPE_TIMESTAMP,
	    'timestamp with time zone' => self::TYPE_TIMESTAMP,
	    'time with time zone' => self::TYPE_TIMESTAMP,
	    'unknown' => self::TYPE_STRING,
	    'uuid' => self::TYPE_STRING,
	    'bit varying' => self::TYPE_STRING,
	    'character varying' => self::TYPE_STRING,
	    'xml' => self::TYPE_STRING
	);

	/**
	 * Creates a query builder for the MySQL database.
	 * @return QueryBuilder query builder instance
	 */
	public function createQueryBuilder() {
		return new QueryBuilder($this->db);
	}

	/**
	 * Resolves the table name and schema name (if any).
	 * @param TableSchema $table the table metadata object
	 * @param string $name the table name
	 */
	protected function resolveTableNames($table, $name) {
		$parts = explode('.', str_replace('"', '', $name));
		if (isset($parts[1])) {
			$table->schemaName = $parts[0];
			$table->name = $parts[1];
{'fraction_non_alphanumeric': 0.1667405110028061, 'fraction_numerical': 0.003249150790134397, 'mean_word_length': 3.514666666666667, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 118, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, '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': '3377220', 'n_tokens_mistral': 2465, 'n_tokens_neox': 2249, 'n_words': 534}