Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yehorbk/pldb
A library that provides functionality for working with simple self-contained databases
https://github.com/yehorbk/pldb
database library php self-contained
Last synced: 3 days ago
JSON representation
A library that provides functionality for working with simple self-contained databases
- Host: GitHub
- URL: https://github.com/yehorbk/pldb
- Owner: yehorbk
- License: mit
- Created: 2019-06-27T20:22:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T16:05:33.000Z (about 4 years ago)
- Last Synced: 2024-04-20T10:48:05.980Z (7 months ago)
- Topics: database, library, php, self-contained
- Language: PHP
- Homepage:
- Size: 42 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Pocket Lite Database
A library that provides functionality for working with simple self-contained databases.# Concept
The main idea of the project is to allow programmers of any level to use the database for simple purposes without the need to install and configure it.# Installation
Use Composer to install `PLDB` into your project:
```
$ composer require yehorbk/pldb
```# Getting Started
Here is a simple program that shows how to create database, create table, insert and select data:```php
createDatabase('pldb-gs');// Creating Table
$usersScheme = array( // Table scheme (field name => field type)
"name" => "text",
"age" => "number",
"address" => "text",
);
$table = $database->createTable('users', $usersScheme);// Creating Users and Inserting Data to Table
class User {
public $name;
public $age;
public $address;
}$john = new User();
$john->name = "John";
$john->age = 27;
$john->address = "London, UK";$abigail = array(
"name" => "Abigail",
"age" => 25,
"address" => "New York City, US",
);// There is the ability to insert both an object and an array
$table->insert($john);
$table->insert($abigail);// Selecting and Printing Data
$condition = array(
"name" => "Abigail",
);
$usersArray = $table->select($condition);
print_r($usersArray);?>
```# Documentation
For more information about library api - check the [docs](https://github.com/yehorbk/PLSQL/blob/master/DOCUMENTATION.md).# Author
**Yehor Bublyk**: [GitHub](https://github.com/yehorbk) • [Twitter](https://twitter.com/yehorbk)