-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mgcostaParedes/readme-1#
fix: readme update #1
- Loading branch information
Showing
3 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: php | ||
|
||
php: | ||
- 7.3 | ||
|
||
env: | ||
global: | ||
- XDEBUG_MODE=coverage | ||
|
||
before_script: | ||
- pecl install grpc | ||
- pecl install protobuf | ||
- echo "extension=grpc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini | ||
- echo "extension=protobuf.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini | ||
- composer install | ||
|
||
script: | ||
- php vendor/bin/codecept run --coverage --coverage-text --coverage-xml | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,38 @@ | ||
## 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**. | ||
[](https://travis-ci.com/mgcostaParedes/spanner-orm-builder) | ||
[](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**. | ||
|
||
### Usage Instructions | ||
|
||
First, we should create a new "Manager" instance. Manager aims to make configuring the library for every framework as easy as possible. | ||
|
||
```PHP | ||
|
||
use MgCosta\Spanner\Manager; | ||
use Google\Cloud\Spanner\Database; | ||
|
||
// $database = your database instance for google cloud spanner; | ||
|
||
$manager = new Manager($database); | ||
$manager->boot(); | ||
|
||
``` | ||
|
||
That's it, you're ready to use the library, just be sure to instantiate the manager as soon as possible on your APP, usually on your bootstrap or config file. | ||
|
||
Once the Manager instance has been registered, we may use it like: | ||
|
||
**Using The Query Builder** | ||
|
||
```PHP | ||
|
||
class User extends \MgCosta\Spanner\Model\Model {} | ||
|
||
$users = User::where('age', '>', 30)->get(); | ||
|
||
``` | ||
|
||
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). |
This file was deleted.
Oops, something went wrong.