{"id":20430981,"url":"https://github.com/ricardo-melo-martins/pdo-wrapper","last_synced_at":"2026-04-07T09:31:34.503Z","repository":{"id":223355998,"uuid":"760062036","full_name":"ricardo-melo-martins/pdo-wrapper","owner":"ricardo-melo-martins","description":"⚡ RMM ⚡Simples abstração de banco de dados em Php 8.x usando conector PDO","archived":false,"fork":false,"pushed_at":"2024-02-21T14:49:31.000Z","size":1808,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T11:21:14.996Z","etag":null,"topics":["docker","mysql","oop","pdo","php8","postgres","sqlite"],"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/ricardo-melo-martins.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":"2024-02-19T17:59:09.000Z","updated_at":"2024-02-20T20:01:27.000Z","dependencies_parsed_at":"2025-01-15T17:21:58.274Z","dependency_job_id":"a9b4cc2c-2535-4fba-87ea-585e2a040cb0","html_url":"https://github.com/ricardo-melo-martins/pdo-wrapper","commit_stats":null,"previous_names":["ricardo-melo-martins/pdo-wrapper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ricardo-melo-martins/pdo-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardo-melo-martins%2Fpdo-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardo-melo-martins%2Fpdo-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardo-melo-martins%2Fpdo-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardo-melo-martins%2Fpdo-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardo-melo-martins","download_url":"https://codeload.github.com/ricardo-melo-martins/pdo-wrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardo-melo-martins%2Fpdo-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31507962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["docker","mysql","oop","pdo","php8","postgres","sqlite"],"created_at":"2024-11-15T08:09:48.944Z","updated_at":"2026-04-07T09:31:34.478Z","avatar_url":"https://github.com/ricardo-melo-martins.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"right\"\u003e\n\n### ⚡ RMM ⚡\n\n\u003c/div\u003e\n\n# pdo-wrapper\n\nSimples abstração de banco de dados em Php 8.x usando conector PDO\n\n## Requisitos\n\n- PHP 8.x\n- extensões do PDO habilitadas no php.ini `pdo_sqlite`, `pdo_mysql` e `pdo_pgsql`  \n- Docker (opcional)\n\n## Características\n\nFunciona com os seguintes bancos de dados\n\n- Sqlite\n- Mysql\n- Postgre\n\n## Como utilizar\n\n```bash\n\nif (! defined('RMM_VERSION')) {\n    require_once dirname(dirname(__DIR__)) . '/autoload.php';\n}\n\nuse RMM\\Database;\n\n$config = [\n    'sqlite'=\u003e [\n        'driver' =\u003e 'sqlite',\n        'database' =\u003e './examples/sqlite/data/Chinook.db',\n    ]\n];\n\ntry {\n\n    $db = new Database($config['sqlite']);\n\n    $db-\u003econnect();\n\n} catch (\\Throwable $th) {\n    print_r($th-\u003egetMessage());\n    exit;\n}\n\n\n$connection = $db-\u003egetConnection();\n\n```\n\nE voilá, tem uma conexão com o banco.\n\nExemplo de consulta usando a conexão criada\n\n```bash\n\n$connection = $db-\u003egetConnection();\n\n$stmt = $connection-\u003equery(\"SELECT EmployeeId, FirstName, LastName, Title FROM Employee\");\n\nforeach ($stmt as $row) {\n    echo($row['EmployeeId'].' | '.$row['FirstName'].' | '.$row['LastName'].' | '.$row['Title'] . PHP_EOL );\n}\n\nunset($db);\n\n```\n\n\n## Exemplos\n\nNo diretório `examples` contém exemplos de conexão com bancos de dados diferentes usando dados de exemplo\n\nConsidere utilizar o Docker para validar facilmente os exemplos para `Mysql` e `Postgres`\n\nPara rodar exemplo 1 [`SQLITE`]\n\n``` bash\n$ php ./examples/sqlite/connect.php\n```\n\nRetorno será algo como isso aqui\n\n![Exemplo 1](docs/example1.png)\n\n\nPara rodar exemplo 2 [`MYSQL`]\n\n``` bash\n$ php ./examples/mysql/connect.php\n```\n\nRetorno será algo como isso aqui\n\n![Exemplo 2](docs/example2.png)\n\nPara rodar exemplo 3 [`POSTGRES`]\n\n``` bash\n$ php ./examples/pgsql/connect.php\n```\n\nRetorno será similar ao anterior (mysql)\n\n## Docker\n\nÉ possível encontrar os scripts e ou bancos de dados para rodar em docker estes exemplos em:\n\nhttps://github.com/ricardo-melo-martins/docker\n\nLá tem as instruções para \"subir\" os dumps em poucos comandos\n\nPara utilizar as configurações do exemplo, acesse o diretório\n\n``` bash\n$ cd .docker/\n```\n\nFaça uma copia do arquivo de exemplo\n\n``` bash\n$ cp .env.example .env\n``` \n\nAs variáveis já possuem usuário e senha usados nos exemplos, mas é possível alterar como quiser. Se alterar apenas lembre-se de mudar em `examples/config/config.php` para que os exemplos continuem funcionando. \n\n\nSeguindo as instruções terá algo como isso no Docker Desktop ...\n\n![containers](docs/docker-containers.png)\n\nAgora é só rodar os exemplos.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardo-melo-martins%2Fpdo-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardo-melo-martins%2Fpdo-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardo-melo-martins%2Fpdo-wrapper/lists"}