v1.0.2 2018-05-28 22:53 UTC


A simple database component, with QueryBuiler, Model. Highly inspired by Eloquent by Laravel.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


You have to be at least PHP >=7.1.


You can you directly from github or using composer

With composer

composer require meltdown/database

Directly from github

git clone

Connecting to database


use Meltdown\Database\Manager\Manager;

//Instante a new Manager to connect to database
$manager = new Manager();

//Connection to database
    'driver'    => 'mysql',
    'host'      => 'localhost',
    'database'  => 'mock',
    'username'  => 'root',
    'password'  => 'toor',
    'charset'   => 'utf8',
    'collation' => utf8_unicode_ci,
    'prefix'    => '',
    'options'   =>  [
        PDO::ATTR_PERSISTENT => true,

//Make the connection available

Using the QueryBuilder


use Meltdown\Database\Manager\Manager as QBuilder;

$posts = QBuilder::table('posts')
                  ->where('post_id' '!=', 25)
                  ->get() // returns Meltdown\Database\Collection\Collection

$comments = QBuilder::table('comments')
                    ->join('posts', 'comments.post_id', '=', 'posts.post_id')
                    ->select('comments.comment', 'posts.*')

Using Models


use Meltdown\Database\Domain\Model;

class Post extends Model


class Comment extends Model
  * A comment belongs to one post.
  public function post()
    return $this->belongsTo('Post', 'post_id');

$posts = new Post();

$posts = $posts->all();

$comments = new Comment();

$comments = $coment->post();

End with an example of getting some data out of the system or using it for a little demo

Running the tests

Explain how to run the automated tests for this system

Break down into end to end tests

Explain what these tests test and why

Give an example

And coding style tests

Explain what these tests test and why

Give an example


Add additional notes about how to deploy this on a live system

Built With

  • Dropwizard - The web framework used
  • Maven - Dependency Management
  • ROME - Used to generate RSS Feeds


Please read for details on our code of conduct, and the process for submitting pull requests to us.


We use SemVer for versioning. For the versions available, see the tags on this repository.


See also the list of contributors who participated in this project.


This project is licensed under the MIT License - see the file for details


  • Hat tip to anyone whose code was used
  • Inspiration
  • etc