Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 994 Bytes

File metadata and controls

47 lines (35 loc) · 994 Bytes

LunaQL PHP Client

This is a PHP client for the LunaQL NoSQL database.

Example

use LunaQL\Database;
use LunaQL\Config\DatabaseConfig;
use LunaQL\Builder\RelationshipBuilder;

$db = new Database(new DatabaseConfig(
    endpoint: "<endpoint>",
    token: '<token>'
));

$objectIDs = $db->query()
    ->from("users")
    ->limit(1)
    ->select(["_fk"])
    ->list("_fk");

$results = $db->query()
    ->from("users")
    ->where("_fk", "in", $objectIDs)
    ->hasMany("tasks", function (RelationshipBuilder $q) {
        $q->where('user_id', '=', '$._id')->orderBy('created_at', 'asc');
    })
    ->fetch();

var_dump($results);

Todo

  • Add tests
  • Implement error handling
  • Implement more query methods

Security

If you discover any security related issues, please email donaldpakkies@gmail.com instead of using the issue tracker.

License

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