Skip to content

Commit

Permalink
fix: updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcostaParedes committed May 7, 2021
1 parent a826920 commit f03a1b4
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Spanner ORM Builder

[![Build Status](https://travis-ci.com/mgcostaParedes/spanner-orm-builder.svg?branch=main)](https://travis-ci.com/mgcostaParedes/spanner-orm-builder)
[![Build Status](https://api.travis-ci.com/mgcostaParedes/spanner-orm-builder.svg)](https://travis-ci.com/mgcostaParedes/spanner-orm-builder)
[![codecov](https://codecov.io/gh/mgcostaParedes/spanner-orm-builder/branch/main/graph/badge.svg?token=OEUY7ZDTOP)](https://codecov.io/gh/mgcostaParedes/spanner-orm-builder)

The Spanner ORM Builder is a database toolkit to PHP, providing an expressive query builder, ActiveRecord style ORM, it can serve as a database layer for your PHP app if you intend to work with **Google Cloud Spanner**.
Expand Down Expand Up @@ -28,11 +28,33 @@ Once the Manager instance has been registered, we may use it like:
**Using The Query Builder**

```PHP
use MgCosta\Spanner\Model\Model;

class User extends \MgCosta\Spanner\Model\Model {}
class User extends Model {}

$users = User::where('age', '>', 30)->get();

```

**Saving a model **

```PHP
use MgCosta\Spanner\Model\Model;

class User extends Model {
protected $primaryKey = 'UserId';

public $name;
public $age;
public $email;
}

$user = new User();
$user->name = 'Miguel';
$user->age = 28;
$user->email = '[email protected]';
$user->save();

```

The implementation of the query builder is inspired on Laravel Query Builder, to get more documentation follow the [link](https://laravel.com/docs/master/queries).

0 comments on commit f03a1b4

Please sign in to comment.