{"id":21233736,"url":"https://github.com/softwarepunt/instarecord","last_synced_at":"2026-02-14T22:34:01.300Z","repository":{"id":57055043,"uuid":"292155421","full_name":"SoftwarePunt/instarecord","owner":"SoftwarePunt","description":"✨ A hyper productive ORM library for PHP + MySQL.","archived":false,"fork":false,"pushed_at":"2025-01-09T16:07:58.000Z","size":344,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T20:16:10.650Z","etag":null,"topics":["database","mysql","orm","php","query-builder"],"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/SoftwarePunt.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-02T02:13:18.000Z","updated_at":"2025-01-09T16:07:13.000Z","dependencies_parsed_at":"2023-11-14T15:28:29.233Z","dependency_job_id":"92b1320e-60d0-42a2-80c5-9852efd52452","html_url":"https://github.com/SoftwarePunt/instarecord","commit_stats":{"total_commits":198,"total_committers":2,"mean_commits":99.0,"dds":"0.13131313131313127","last_synced_commit":"b57a3661d12966872151e7bb7572d0838c4afd20"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/SoftwarePunt/instarecord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwarePunt%2Finstarecord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwarePunt%2Finstarecord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwarePunt%2Finstarecord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwarePunt%2Finstarecord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SoftwarePunt","download_url":"https://codeload.github.com/SoftwarePunt/instarecord/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftwarePunt%2Finstarecord/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000775,"owners_count":26082906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["database","mysql","orm","php","query-builder"],"created_at":"2024-11-21T00:00:16.474Z","updated_at":"2026-02-14T22:34:01.294Z","avatar_url":"https://github.com/SoftwarePunt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instarecord\n**✨ A hyper productive ORM for PHP.**\n\n[![Packagist Version](https://img.shields.io/packagist/v/softwarepunt/instarecord?logo=packagist)](https://packagist.org/packages/softwarepunt/instarecord)\n[![PHPUnit](https://github.com/SoftwarePunt/instarecord/actions/workflows/phpunit.yml/badge.svg)](https://github.com/SoftwarePunt/instarecord/actions/workflows/phpunit.yml)\n\nInstarecord makes it super easy and fun to work with MySQL databases in PHP. It's fast and intuitive, and loaded with optional features to make your life easier.\n\n## The pitch\n🧙‍♂️ Define your models with typed variables, and Instarecord figures out the rest!\n\n```php\n\u003c?php\n\nclass User extends Model\n{\n    public int $id;\n    public string $email;\n    public ?string $name;\n}\n\n$user = new User();\n$user-\u003eemail = \"bob@web.net\";\n$user-\u003esave(); \n\necho \"Created user #{$user-\u003eid}!\";\n```\n\n## Features\n\n### 🗺️ [Object Mapping](./docs/ObjectMapping.md)\nDefine your models as pure PHP classes with typed properties. Use them like regular objects.\n\n### 📦 [Easy CRUD](./docs/CRUD.md)\nUse intuitive object-oriented CRUD (create, read, update, and delete) operations on your models.\n\n### 🔎 [Query Builder](./docs/Queries.md)\nUse the query builder to quickly build and run more complex queries with prepared statements.\n\n### 🤝 [Relationships](./docs/Relationships.md)\nSet up relationships between your models and easily load them in an optimized way.\n\n### ✅ [Validation](./docs/Validation.md)\nAdd constraints to your model properties and validate them with user-friendly error messages. \n\n### 🕑 [Caching](./docs/Caching.md)\nUse model caching features to prevent unnecessary or duplicate queries.\n\n## Quickstart\n\n### Installation\nAdd Instarecord to your project with [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require softwarepunt/instarecord\n```\n\n### Configuration\nPass your own `DatabaseConfig` or modify the default one:\n\n```php\n\u003c?php\n\nuse SoftwarePunt\\Instarecord\\Instarecord;\n\n$config = Instarecord::config();\n$config-\u003echarset = \"utf8mb4\";\n$config-\u003eunix_socket = \"/var/run/mysqld/mysqld.sock\";\n$config-\u003eusername = \"my_user\";\n$config-\u003epassword = \"my_password\";\n$config-\u003edatabase = \"my_database\";\n$config-\u003etimezone = \"UTC\";\n```  \n\n### Use models\nDefines your models by creating normal classes with public properties, and extending `Model`:\n\n```php\n\u003c?php\n\nuse SoftwarePunt\\Instarecord\\Model;\n\nclass Car extends Model\n{\n    public int $id;\n    public string $make;\n    public string $model;\n    public int $year;\n}\n```\n\nNow you can create, read, update, and delete records with ease:\n\n```php\n$car = new Car();\n$car-\u003emake = \"Toyota\";\n$car-\u003emodel = \"Corolla\";\n$car-\u003eyear = 2005;\n$car-\u003esave(); // INSERT INTO cars [..]\n\n// Post insert, the primary key (id) is automatically populated\n\n$car-\u003eyear = 2006;\n$car-\u003esave(); // UPDATE cars SET year = 2006 WHERE id = 123\n\n$car-\u003edelete(); // DELETE FROM cars WHERE id = 123\n```\n\n### Run queries\nYou can easily build and run custom queries, and get results in various ways - from raw data to fully populated models.\n\n#### From models\n```php\n$matchingCars = Car::query()\n    -\u003ewhere('make = ?', 'Toyota')\n    -\u003eandWhere('year \u003e ?', 2000)\n    -\u003eorderBy('year DESC')\n    -\u003elimit(10)\n    -\u003equeryAllModels(); // Car[]\n```\n\n#### Standalone\n\n```php\n$carsPerYear = Instarecord::query()\n    -\u003eselect('year, COUNT(*) as count')\n    -\u003efrom('cars')\n    -\u003egroupBy('year')\n    -\u003equeryKeyValueArray(); // [2005 =\u003e 10, 2006 =\u003e 5, ..]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwarepunt%2Finstarecord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwarepunt%2Finstarecord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwarepunt%2Finstarecord/lists"}