2017-25 © Pedro Peláez
 

library database

Light weight database abstraction

image

ark/database

Light weight database abstraction

  • Friday, November 24, 2017
  • by ddliu
  • Repository
  • 2 Watchers
  • 8 Stars
  • 2,593 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 14 Versions
  • 47 % Grown

The README.md

ark/database Travis Documentation Status Packagist

Light weight database abstraction., (*1)

Document, (*2)

API, (*3)

Quick Start

Create Database Connection

First of all, create a database connection with DSN, username and password. Take the Mysql Database for example:, (*4)

<?php
use Ark\Database\Connection;

$db = new Connection('mysql:host=localhost;dbname=testdb', 'username', 'password');

Query Builder

<?php
// Query
$db->builder()
    ->select('*')
    ->from('user')
    ->where('age > :age and created_at > :time', [
        ':age' => 20,
        ':time' => time() - 3600
    ])
    ->limit(10)
    ->queryAll();

// Insert
$db->builder()
    ->insert('user', [
        'name' => 'user1',
        'password' => 'pa$$word',
    ]);

Work with Model

<?php
// Create model factory
$factory = $db->factory('@user');

// Insert
$factory->insert([
    'name' => 'user1',
    'age' => 20,
]);

// Get model
$user = $factory->findOneByName('user1');

// Update
$user->email = 'user1@example.com';
$user->save();

// Delete
$user->delete();

The Versions

24/11 2017

dev-master

9999999-dev https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

The Requires

 

database postgresql mysql sqlite sqlite3

24/11 2017

v0.2.2

0.2.2.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

The Requires

 

database postgresql mysql sqlite sqlite3

10/05 2017

v0.2.1

0.2.1.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

The Requires

 

database postgresql mysql sqlite sqlite3

28/10 2016

v0.2.0

0.2.0.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

27/10 2016

v0.1.9

0.1.9.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

29/03 2016

v0.1.8

0.1.8.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

09/03 2016

v0.1.7

0.1.7.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

25/08 2015

v0.1.6

0.1.6.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

27/05 2015

v0.1.5

0.1.5.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

26/05 2015

v0.1.4

0.1.4.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

14/05 2015

v0.1.3

0.1.3.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

12/05 2015

v0.1.2

0.1.2.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

09/05 2015

v0.1.1

0.1.1.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3

31/03 2015

v0.1.0

0.1.0.0 https://github.com/arkphp/database

Light weight database abstraction

  Sources   Download

MIT

database postgresql mysql sqlite sqlite3