Installs: 1 079

Dependents: 5

Suggesters: 1

Stars: 0

Watchers: 1

Forks: 0

v0.3.1 2016-05-13 11:31 UTC



Build Status

The DB package lets you manipulate the database, build SQL queries and manipulate the tables structure with Schema.

##Installation If you are working on an Asgard project you don't need to install this library as it is already part of the standard libraries.

composer require asgard/db 0.*


To connect to the database and make SQL queries. See the documentation.

$rows = $db->query('SELECT * FROM news ORDER BY id DESC')->all();


To build SQL queries in a Object-Oriented manner. See the documentation.

$rows = $db-dal->from('news')->orderBy('id DESC')->all();


Build, modify and drop tables. See the documentation.

schema->table('news', function($table) {
	$table->addColumn('id', 'integer', [
		'length' => 11,
		'autoincrement' => true,
	$table->addColumn('created_at', 'datetime', [
	$table->addColumn('updated_at', 'datetime', [
	$table->addColumn('title', 'string', [
		'length' => '255',



List of commands that come with the DB package.


Please submit all issues and pull requests to the asgardphp/asgard repository.


The Asgard framework is open-sourced software licensed under the MIT license