{"id":15025439,"url":"https://github.com/tomwright/extendedpdo","last_synced_at":"2026-04-04T06:36:17.317Z","repository":{"id":57071523,"uuid":"73401678","full_name":"TomWright/ExtendedPDO","owner":"TomWright","description":"A simple PDO Wrapper and Query Builder made to shorten the time it takes to get results from basic SQL queries.","archived":false,"fork":false,"pushed_at":"2017-11-21T12:26:01.000Z","size":42,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T18:44:00.346Z","etag":null,"topics":["database","database-access","mysql","pdo","pdo-wrapper","php","php-7","query-builder","singleton","sql"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TomWright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-10T16:45:55.000Z","updated_at":"2024-10-26T11:51:09.000Z","dependencies_parsed_at":"2022-08-24T14:54:28.735Z","dependency_job_id":null,"html_url":"https://github.com/TomWright/ExtendedPDO","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomWright%2FExtendedPDO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomWright%2FExtendedPDO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomWright%2FExtendedPDO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomWright%2FExtendedPDO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomWright","download_url":"https://codeload.github.com/TomWright/ExtendedPDO/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243324266,"owners_count":20273099,"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","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","database-access","mysql","pdo","pdo-wrapper","php","php-7","query-builder","singleton","sql"],"created_at":"2024-09-24T20:02:20.467Z","updated_at":"2025-12-28T08:00:45.892Z","avatar_url":"https://github.com/TomWright.png","language":"PHP","readme":"# Extended PDO\n\n[![Build Status](https://travis-ci.org/TomWright/ExtendedPDO.svg?branch=master)](https://travis-ci.org/TomWright/ExtendedPDO)\n[![Latest Stable Version](https://poser.pugx.org/tomwright/extended-pdo/v/stable)](https://packagist.org/packages/tomwright/extended-pdo)\n[![Total Downloads](https://poser.pugx.org/tomwright/extended-pdo/downloads)](https://packagist.org/packages/tomwright/extended-pdo)\n[![Monthly Downloads](https://poser.pugx.org/tomwright/extended-pdo/d/monthly)](https://packagist.org/packages/tomwright/extended-pdo)\n[![Daily Downloads](https://poser.pugx.org/tomwright/extended-pdo/d/daily)](https://packagist.org/packages/tomwright/extended-pdo)\n[![License](https://poser.pugx.org/tomwright/extended-pdo/license.svg)](https://packagist.org/packages/tomwright/extended-pdo)\n\n## Installation\n\n```\ncomposer install tomwright/extended-pdo\n```\n\n## Connecting\n\nExtendedPDO implements the singleton design pattern using [tomwright/singleton](https://github.com/TomWright/Singleton).\nFor more information on how the following code works, see the [documentation](https://github.com/TomWright/Singleton).\n\n```php\n$db = ExtendedPDO::createConnection($dsn, $username, $password, 'my-main-db');\n$db2 = ExtendedPDO::getInstance('my-main-db');\n\nvar_dump($db === $db2) // TRUE\n```\n\n## Usage\n```php\n// Returns an array of records\n$db-\u003equeryAll('SELECT * FROM users WHERE username = :username', [':username' =\u003e 'Tom']);\n\n// Returns the first record\n$db-\u003equeryRow('SELECT * FROM users WHERE username = :username LIMIT 1', [':username' =\u003e 'Tom']);\n```\n\n## Query Return Types\nYou can set the return type of the `dbQuery()`, `queryAll()` and `queryRow()` methods using `$db-\u003esetReturnType($x)` where `$x` is the return type you'd like to use.\n\nAvailable return types are as follows:\n\n- `ExtendedPDO::RETURN_TYPE_OBJECT` - Your results will be returned as objects\n- `ExtendedPDO::RETURN_TYPE_ASSOC` - Your results will be returned as associative arrays\n- `ExtendedPDO::RETURN_TYPE_STMT` - The statement object will be returned directly\n\nYou can also set a return type of `\\PDO::FETCH_ASSOC` for example and it will override any of the above. This makes all of the standard `PDO` fetch types usable.\n\n## Query Builder\n\nExtendedPDO also comes with it's own [Query Builder](https://github.com/TomWright/QueryBuilderPHP).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomwright%2Fextendedpdo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomwright%2Fextendedpdo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomwright%2Fextendedpdo/lists"}