An open API service indexing awesome lists of open source software.

https://github.com/abbychau/hackabase


https://github.com/abbychau/hackabase

Last synced: about 2 months ago
JSON representation

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]);
```