A package for using Google Datastore as a database driver

Overview

Laravel Eloquent for Google Datastore

Latest Stable Version License

A package for using Google Datastore as a database driver.


By using this package, you can use query builder and eloquent to access data from datastore.

Installation

This package requires Laravel 9.x & PHP 8.1 as a minimum.

You can install the package via composer:

composer require a1comms/eloquent-datastore

If you are using Laravel Package Auto-Discovery, you don't need you to manually add the ServiceProvider.

Without auto-discovery:

If you don't use auto-discovery, add the below ServiceProvider to the $providers array in config/app.php file.

A1comms\EloquentDatastore\DatastoreServiceProvider::class,

Roadmap

  • Read data using query builder.
  • Read data using Eloquent model.
  • Insert data using Eloquent model.
  • Update data using Eloquent model.
  • Delete data.
  • Keys only queries.
  • Auto-generated primary key.
  • Read multiple pages of data with Datastore cursors.
  • Batch update from Eloquent collection.
  • Cursor Paginate.
  • Ancestor key relations.

Usage

You need to add datastore connection in config/database.php file.

'connections' => [
    ...
    'datastore' => [
        'driver' => 'datastore',
        'transport' => env('DATASTORE_TRANSPORT', 'grpc'),
    ],
    ...
],

Access using Eloquent Model

You need to extend A1comms\EloquentDatastore\Eloquent\Model class instead of Laravel's default Eloquent model class.

Example-



namespace App\Models;

use A1comms\EloquentDatastore\Eloquent\Model;

class Project extends Model
{
    // Your works here
}

Access using Query Builder

Example-

DB::connection('datastore')
    ->table('projects')
    ->where('project_id', '>', 5)
    ->skip(3)
    ->take(5)
    ->get();

It will return a collection.

Tested Builder Functions

  • connection
  • table
  • from
  • select (for projection query)
  • kind (same as table)
  • where (Available: = , > , < , >= , <= )
  • limit / take
  • skip
  • orderBy
  • distinct
  • get
  • pluck
  • exists
  • count
  • simplePaginate
  • paginate (works same as simplePaginate)
  • first
  • delete
  • insert
  • _upsert (different and incompatible with default upsert)
  • find / lookup
  • chunk / chunkMap / each
  • lazy / cursor

Contribution Guide

You can contribute by reporting bugs, fixing bugs, submitting and reviewing pull requests.

Go to issues section, and you can start working on an issue immediately.

License

The MIT License (MIT). Please see License File for more information.

You might also like...
[Package] Multi-tenant Database Schema Manager for Laravel

Multi-tenant Database Schema Manager for Laravel Tenanti allow you to manage multi-tenant data schema and migration manager for your Laravel applicati

A mysql database backup package for laravel

Laravel Database Backup Package This package will take backup your mysql database automatically via cron job. Installing laravel-backup The recommende

This package provides a framework-agnostic database backup manager for dumping to and restoring databases from S3, Dropbox, FTP, SFTP, and Rackspace Cloud

Database Backup Manager This package provides a framework-agnostic database backup manager for dumping to and restoring databases from S3, Dropbox, FT

The lightweight PHP database framework to accelerate development
The lightweight PHP database framework to accelerate development

The lightweight PHP database framework to accelerate development Features Lightweight - Less than 100 KB, portable with only one file Easy - Extremely

[READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework)

Illuminate Database The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style OR

ORM layer that creates models, config and database on the fly

RedBeanPHP 5 RedBeanPHP is an easy to use ORM tool for PHP. Automatically creates tables and columns as you go No configuration, just fire and forget

Spot v2.x DataMapper built on top of Doctrine's Database Abstraction Layer

Spot DataMapper ORM v2.0 Spot v2.x is built on the Doctrine DBAL, and targets PHP 5.4+. The aim of Spot is to be a lightweight DataMapper alternative

SQL database access through PDO.

Aura.Sql Provides an extension to the native PDO along with a profiler and connection locator. Because ExtendedPdo is an extension of the native PDO,

PHP Database Migrations for Everyone
PHP Database Migrations for Everyone

Phinx: Simple PHP Database Migrations Intro Phinx makes it ridiculously easy to manage the database migrations for your PHP app. In less than 5 minute

Releases(v1.0.12)
Pure PHP NoSQL database with no dependency. Flat file, JSON based document database.

Please give it a Star if you like the project ?? ❤️ SleekDB - A NoSQL Database made using PHP Full documentation: https://sleekdb.github.io/ SleekDB i

Kazi Mehedi Hasan 745 Jan 7, 2023
SleekwareDB is a NoSQL database storage service. A database storage service that can be used for various platforms and is easy to integrate.

SleekwareDB is a NoSQL database storage service. A database storage service that can be used for various platforms and is easy to integrate. NoSQL API

SleekwareDB 12 Dec 11, 2022
Driver to seamlessly integrate the Backup Manager into Laravel applications.

Laravel Driver for the Database Backup Manager This package pulls in the framework agnostic Backup Manager and provides seamless integration with Lara

Backup Manager 636 Dec 30, 2022
Oracle DB driver for Laravel 4|5|6|7|8 via OCI8

Oracle DB driver for Laravel 4|5|6|7|8 via OCI8 Laravel-OCI8 Laravel-OCI8 is an Oracle Database Driver package for Laravel. Laravel-OCI8 is an extensi

Arjay Angeles 751 Jan 6, 2023
🔌 A Doctrine DBAL Driver implementation on top of Swoole Coroutine PostgreSQL extension

Swoole Coroutine PostgreSQL Doctrine DBAL Driver A Doctrine\DBAL\Driver implementation on top of Swoole\Coroutine\PostgreSQL. Getting started Install

Leo Cavalcante 19 Nov 25, 2022
Doctrine PHP mapping driver

WORK IN PROGRESS! Doctrine PHP mapping driver Alternative mapping driver that allows to write mappings in PHP. Documentation Associations examples TOD

Andrey Klimenko 3 Aug 15, 2021
Laravel 5.1 ODBC Driver

l5-odbc-driver Laravel 5.1 ODBC driver Installation To Install this in your Laravel 5.1 app, open composer.json and add: "require": { "garylocke/odb

Gary Locke 8 Sep 19, 2019
A PHP client driver for the RethinkDB query language (ReQL).

PHP-RQL A PHP client driver for the RethinkDB query language (ReQL).

Daniel Mewes 341 Dec 30, 2022
Feather - a highly performant SQLite Cache Driver for Kirby 3

?? Kirby3 SQLite Cache-Driver Feather - a highly performant SQLite Cache Driver for Kirby 3 Commerical Usage Support open source! This plugin is free

Bruno Meilick 1 Dec 15, 2021
The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

Mark Armendariz 0 Jan 7, 2022