Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/torres-developer/pdowrapperapi
An Wrapper API for the PHP PDO
https://github.com/torres-developer/pdowrapperapi
composer composer-library composer-package pdo pdo-mysql pdo-php pdo-wrapper php php8
Last synced: 6 days ago
JSON representation
An Wrapper API for the PHP PDO
- Host: GitHub
- URL: https://github.com/torres-developer/pdowrapperapi
- Owner: torres-developer
- License: agpl-3.0
- Created: 2022-10-15T23:37:40.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-16T21:32:34.000Z (about 2 years ago)
- Last Synced: 2024-11-15T21:46:39.986Z (2 months ago)
- Topics: composer, composer-library, composer-package, pdo, pdo-mysql, pdo-php, pdo-wrapper, php, php8
- Language: PHP
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PDOWrapperAPI
An Wrapper API for the PHP PDO.# Basic Usage:
```php
"192.168.1.40",
"database" => "exampleDatabase",
], Core\Credentials::getCredentials(
"user",
"passwd"
))
);/*
* Use the CRUD interface for easy operations:
* - select;
* - insert;
* - update;
* - delete.
*/// get all from all users
$dbh->select("user")->fetchAll(PDO::FETCH_OBJ);
// get all users `id`
$dbh->select("id", "user")->fetchAll(PDO::FETCH_OBJ);
// get all users `name` and `age`
$dbh->select(["name", "age"], "user")->fetchAll(PDO::FETCH_OBJ);// insert new users
$users = [
["id" => 123, "name" => "asdfs"],
["age" => 2],
["id" => null, "text" => "y7tgebh"]
];
$dbh->insert("user", ...$users);/*
* You can use a query builder for more complex operations:
*/
$dbh->getBuider()->select()
->from("user")
->limit(5)
->run()
->fetchAll(\PDO::FETCH_OBJ)
```