https://github.com/abbychau/hackabase
https://github.com/abbychau/hackabase
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/abbychau/hackabase
- Owner: abbychau
- Created: 2020-04-26T05:38:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T06:33:27.000Z (about 5 years ago)
- Last Synced: 2025-02-14T03:15:26.499Z (4 months ago)
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HackaBase
The last DBaaS you need.
## Usage:
### Initialization / migration
```php
[
['name'=>'Peter', 'age'=>30, 'mass'=>71.1, 'parent_id'=>3],
['name'=>'John', 'age'=>33, 'mass'=>73.1, 'parent_id'=>1],
['age','mass','parent_id']//indexes
],
'parents'=>['name'=>'Tifa', 'age'=>66, 'mass'=>40, 'slogan'=>'I love my dad']
];
$hbConn->AutoMigrate(
$tableSampleData,
hb::RELATIONAL_DB, //Storage type, can be //hb::DOCUMENT_STORE //hb::COLUMN_STORE
SECRET_TOKEN,
true //create table structure only or load data as well
);
```### HTTP(s)
This is for quick prototyping and light-weight usage:
```
$hbConn = hb::CreateHttpConnection(SECRET_TOKEN);
$result = $hbConn->DbAr("SELECT u.name, p.name FROM users u, parents WHERE u.parent_id = p.id WHERE u.id = :id", ['id'=>$_GET['id']]);
print_r($result[0]);
```### TCP
This is for heavy and prolong operations: (good for production)
```
DbAr("SELECT u.name, p.name FROM users u, parents WHERE u.parent_id = p.id");
print_r($result[0]);
```