{"id":26814519,"url":"https://github.com/i-excellent/yii2-pgsql-schema","last_synced_at":"2026-04-18T00:01:55.467Z","repository":{"id":56987860,"uuid":"114549258","full_name":"i-excellent/yii2-pgsql-schema","owner":"i-excellent","description":"Improved PostgreSQL schemas for Yii2.","archived":false,"fork":false,"pushed_at":"2017-12-17T19:00:23.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T02:15:46.009Z","etag":null,"topics":["extension","jsonb","postgresql","postgresql-database","schema","yii2"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-excellent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-17T15:55:49.000Z","updated_at":"2017-12-17T19:22:20.000Z","dependencies_parsed_at":"2022-08-21T12:50:25.377Z","dependency_job_id":null,"html_url":"https://github.com/i-excellent/yii2-pgsql-schema","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/i-excellent/yii2-pgsql-schema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-excellent%2Fyii2-pgsql-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-excellent%2Fyii2-pgsql-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-excellent%2Fyii2-pgsql-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-excellent%2Fyii2-pgsql-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-excellent","download_url":"https://codeload.github.com/i-excellent/yii2-pgsql-schema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-excellent%2Fyii2-pgsql-schema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extension","jsonb","postgresql","postgresql-database","schema","yii2"],"created_at":"2025-03-30T02:15:49.638Z","updated_at":"2026-04-18T00:01:55.435Z","avatar_url":"https://github.com/i-excellent.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"yii2-pgsql\n==============\n\nImproved PostgreSQL schemas for Yii2.\n\nSupports follow types for ActiveRecord models:\n\n[![Latest Stable Version](https://poser.pugx.org/i-excellent/yii2-pgsql-schema/v/stable)](https://packagist.org/packages/i-excellent/yii2-pgsql-schema)\n[![License](https://poser.pugx.org/i-excellent/yii2-pgsql-schema/license)](https://packagist.org/packages/i-excellent/yii2-pgsql-schema)\n\nLimitation\n------------\n\nWhen you use this extension you can't specify the PDO type by using an array: `[value, type]`,\n\ne.g. `['name' =\u003e 'John', 'profile' =\u003e [$profile, \\PDO::PARAM_LOB]]`.\n\nSee the issue [#7481](https://github.com/yiisoft/yii2/issues/7481)\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist i-excellent/yii2-pgsql-schema\n```\n\nor add\n\n```\n\"i-excellent/yii2-pgsql-schema\": \"~1.0\"\n```\n\nto the require section of your `composer.json` file.\n\n \nConfiguration\n-------------\nOnce the extension is installed, add following code to your application configuration:\n\n```php\nreturn [\n    //...\n    'components' =\u003e [\n        'db' =\u003e [\n            'class' =\u003e 'yii\\db\\Connection',\n            'dsn' =\u003e 'pgsql:host=localhost;dbname=\u003cdatabase\u003e',\n            'username' =\u003e 'postgres',\n            'password' =\u003e '\u003cpassword\u003e',\n            'schemaMap' =\u003e [\n                'pgsql'=\u003e 'excellent\\pgsql\\Schema',\n            ],\n        ],\n    ],\n];\n```\n\n\n\nConfigure Model's rules\n```php\n/**\n * @property string[] $attribute1 array of string\n * @property array $attribute2 associative array or just array\n * @property integer|string|\\DateTime $attribute3 for more information about the type see \\Yii::$app-\u003eformatter-\u003easDatetime()\n */\nclass Model extends ActiveRecord\n{\n    //...\n    public function rules()\n    {\n        return [\n            [['attribute1'], 'each', 'rule' =\u003e ['string']],\n            [['attribute2'], 'safe'],\n        ];\n    }\n}\n```\n\t\nUsage\n-----\n\nYou can then save array, json and timestamp types in database as follows:\n\n```php\n/**\n * @var ActiveRecord $model\n */\n$model-\u003eattribute1 = ['some', 'values', 'of', 'array'];\n$model-\u003eattribute2 = ['some' =\u003e 'values', 'of' =\u003e 'array'];\n$model-\u003esave();\n```\n\nand then use them in your code\n```php\n/**\n * @var ActiveRecord $model\n */\n$model = Model::findOne($pk);\n$model-\u003eattribute1; // is array\n$model-\u003eattribute2; // is associative array (decoded json)\n\n```\n\n[Composite types](docs/composite.md)\n\nLicense\n-------\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-excellent%2Fyii2-pgsql-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-excellent%2Fyii2-pgsql-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-excellent%2Fyii2-pgsql-schema/lists"}