{"id":15025842,"url":"https://github.com/omarajmi/dalphppdo","last_synced_at":"2025-04-09T20:04:43.286Z","repository":{"id":202395130,"uuid":"129439107","full_name":"omarAjmi/DALphpPDO","owner":"omarAjmi","description":"Php database abstraction layer using PDO","archived":false,"fork":false,"pushed_at":"2018-04-16T22:38:36.000Z","size":55,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T20:04:35.980Z","etag":null,"topics":["database","database-abstraction","database-layer","php-library","php7","php71"],"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/omarAjmi.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}},"created_at":"2018-04-13T18:23:20.000Z","updated_at":"2021-08-05T14:15:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e668771-eece-46bf-8944-5ee3c3e52cd0","html_url":"https://github.com/omarAjmi/DALphpPDO","commit_stats":null,"previous_names":["omarajmi/dalphppdo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarAjmi%2FDALphpPDO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarAjmi%2FDALphpPDO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarAjmi%2FDALphpPDO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omarAjmi%2FDALphpPDO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omarAjmi","download_url":"https://codeload.github.com/omarAjmi/DALphpPDO/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103868,"owners_count":21048245,"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-abstraction","database-layer","php-library","php7","php71"],"created_at":"2024-09-24T20:03:08.056Z","updated_at":"2025-04-09T20:04:43.262Z","avatar_url":"https://github.com/omarAjmi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# DALphpPDO Version 1.0\n\n**DALphpPDO** is a **php** library that allows you to connect, query and obtain results from all major relational dbms.\n\n## List of supported **RDBMS**:\n\n - [Mysql](https://www.mysql.com/) (default)\n   [PostgresSQL](https://postgresql.org/).\n   [Oracle](https://www.oracle.com/database)\n   [SqlServer](https://www.microsoft.com/en-us/sql-server)\n   [SqlLite](https://sqlite.org/)\n   [Ibm](https://www.ibm.com/db2/)\n   [Sybase](http://www.sybase.com/)\n   [Odbc](https://docs.microsoft.com/en-us/sql/odbc/microsoft-open-database-connectivity-odbc)\n\n## Loading Database connection configurations:\n\nconfigurations residesin the **/Settings.php** file.\n**Example of Mysql configs:**\n\n    'mysql'  =\u003e  [  //the default pool (driver)\n\t    'driver'  =\u003e  'mysql',\n\t    'host'  =\u003e  'localhost',\n\t    'dbname'  =\u003e  'database_name',\n\t    'user'  =\u003e  'user',\n\t    'password'  =\u003e  'passwd',\n\t    'prefix'  =\u003e  'DB1_',\n\t    'port'  =\u003e  3306,\n\t    'persistent'  =\u003e  1,\n\t    'fetchmode'  =\u003e  'object',\n\t    'prepare'  =\u003e  1\n    ],\nconfigurations are devised as pools, each pool hase the correspondant RDBMS driver name as a global name for the pool like the exemple above.\nloading these configurations is strait forward:\n\n    $configs  =  new  DatabaseConfiguration();\n    /**\n\t * without parameters loads the default configurations\n\t * for the default pool which is mysql\n\t */\nor:\n\n    $configs  =  new  DatabaseConfiguration('pgsql');\n\nor\n\n    $configs  =  new  DatabaseConfiguration('odbc',  'path/to/settings/file');\n\n## Creating a connection instance:\n\ncreating the connection instance requires a DatabaseConfiguration object that holds all the necessary parameters to open a connection throgh PHP's PDO.\ncreating a connection instance is strait forward:\n\n    $dbConnect  =  new  DatabaseConnection($configs);\n\n## Querying databases:\n\nfor database queries you need to instantiate the QueryBuilderBase which is the engin that generates SQL queries and execute them without the need to deal directly with SQL syntax.\nall this object needs is the DatabaseConnection object that holds all the necessary infos for the database connection.\n\n    $qb  =  new  QueryBuilderBase($dbConnect);\n\n### creating queries:\n\ncreating queries is as simple as creating native SQL queries.\n#### Select:\n\n    $qb-\u003eselect('column_name')-\u003efrom('table_name');\n    //selects a spesific column from the spesific table\nor\n\n    $qb-\u003eselect(['column_name', 'column_name',...])-\u003efrom('table_name');\n    //selects multiple columns from the spesific table\n   or\n\n    $qb-\u003eselect()-\u003efrom('table_name');\n    //selects all columns from the spesific table\n\n#### Where:\n\n    $qb-\u003eselect('column_name')-\u003efrom('table_name')-\u003ewhere(\"column = value\");\n#### and where:\n\n    $qb-\u003eselect('column_name')-\u003efrom('table_name')-\u003ewhere(\"column = value\")-\u003eandWhere(\"column = value\");\n#### or where:\n\n    $qb-\u003eselect('column_name')-\u003efrom('table_name')-\u003ewhere(\"column = value\")-\u003eorWhere(\"column = value\");\n\n#### groupBy\n\n    $qb-\u003eselect('column_name')-\u003efrom('table_name')-\u003ewhere(\"column = value\")-\u003eorWhere(\"column = value\")-\u003egroupBy(\"column_name\");\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarajmi%2Fdalphppdo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomarajmi%2Fdalphppdo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomarajmi%2Fdalphppdo/lists"}