An unofficial EdgeDB PHP client.

Overview

Unofficial EdgeDB HTTP PHP client

Requirements

  • PHP >= 8.0 (with fileinfo and mbstring)
  • An EdgeDB server instance (tested with 1.0+9ecadfc)

Quickstart

Add this package to your project:

$ composer require teddybear06/edgedb-php

This is a complete usage example (or look at https://github.com/TeddyBear06/edgedb-php/tree/main/example/index.php):

// Require Composer's autoloader 
require '/vendor/autoload.php';

// Use required classes
use TeddyBear06\EdgeDbPhp\EdgeDbHttpClient;
use TeddyBear06\EdgeDbPhp\EdgeQlQuery;

// Establish a connection with the EdgeDB server instance
$connection = new EdgeDbHttpClient('127.0.0.1', '10700', 'edgedb');

// Create an EdgeQL query
$query = new EdgeQlQuery(
    'select Author {firstname, lastname} filter .lastname = <str>$lastname;', 
    ['lastname' => 'Doe']
);

// Execute the query
$response = $connection->query($query);

// If there is no error message
if (is_null($response->getError())) {

    // If there is at least 1 result
    if ($response->countData() > 0) {

        // Loop over results
        foreach ($response->getData() as $data) {
            echo $data['prenom'];
        }

    } else {

        // Data set is empty
        echo 'No matches found...';

    }

} else {

    // Call $response->getError() to get error details
    // message, type or code array indexes are available
    echo $response->getError()['message'];

}

Documentation

For a complete API documentation, please go here : https://teddybear06.github.io/edgedb-php/

You might also like...
Idiomatic PHP client for Google Compute.

Google Compute for PHP Idiomatic PHP client for Google Compute. API Documentation NOTE: This repository is part of Google Cloud PHP. Any support reque

A standalone Amazon S3 (REST) client for PHP 5/CURL

Amazon S3 PHP Class Usage OO method (e,g; $s3-getObject(...)): $s3 = new S3($awsAccessKey, $awsSecretKey); Statically (e,g; S3::getObject(...)): S3::

A PHP implementation of RabbitMQ Client for webman plugin.
A PHP implementation of RabbitMQ Client for webman plugin.

workbunny/webman-rabbitmq 🐇 A PHP implementation of RabbitMQ Client for webman plugin. 🐇 A PHP implementation of RabbitMQ Client for webman plugin 常

PHP DataDog StatsD Client

PHP DataDog StatsD Client This is an extremely simple PHP DogStatsD client. Requires PHP = 5.6.0. See CHANGELOG.md for changes. For a Laravel-specifi

A PHP MySQL database client class to simplify database access

This lightweight database class is written with PHP and uses the MySQLi extension, it uses prepared statements to properly secure your queries, no need to worry about SQL injection attacks.

Idiomatic PHP client for Cloud Firestore.

Cloud Firestore for PHP Idiomatic PHP client for Cloud Firestore. API documentation NOTE: This repository is part of Google Cloud PHP. Any support req

A PHP API client for ConvertKit

ConvertKit PHP API Client Introduction This is an API Client for the ConvertKit mailing list service for PHP versions 7.4 and up There are several cli

PHP client library for Coveralls API.

php-coveralls PHP client library for Coveralls. Prerequisites PHP 5.5+ for 2.x or 5.3+ for 1.x On GitHub Building on Travis CI, CircleCI, Jenkins or C

Idiomatic PHP client for Memorystore for Memcached.

Memorystore for Memcached for PHP Idiomatic PHP client for Memorystore for Memcached. API documentation NOTE: This repository is part of Google Cloud

Releases(v0.3.1)
Owner
T3d
T3d
An unofficial PHP SDK for Deepgram's API.

An unofficial PHP SDK for Deepgram's audio transcription API. Getting Started Grab src/deepgram.php and include it in your project. Then: $deepgram =

Christopher Finke 1 May 3, 2022
Unofficial Nest Learning Thermostat API

This is a PHP class that will allow you to monitor and control your Nest Learning Thermostat, and Nest Protect.

Guillaume Boudreau 297 Oct 28, 2022
Complete Pipedrive API client for PHP

Complete Pipedrive API client for PHP Contribute by referral code / link This won't take much time. You could use my referral code or link to get up t

Israel Ortuño 155 Dec 7, 2022
A GETTR.com client library written in PHP with Laravel support.

Gettr API Clinet PHP A GETTR.com client library written in PHP with Laravel support. This library uses unofficial publicly accessible API endpoints of

null 10 Dec 13, 2022
SendCloud client for PHP

SendCloud client for PHP Installation composer require guangda/sendcloud Example $mailData = [ 'to'=>'[email protected]', 'subject'=>'test',

Guangda 3 Aug 27, 2021
Bearer client for the PHP programming language

Bearer PHP Client This is the official PHP client for interacting with Bearer.sh. Installation Install the package by running: composer require bearer

Bearer 9 Oct 31, 2022
The most widely used PHP client for RabbitMQ

php-amqplib This library is a pure PHP implementation of the AMQP 0-9-1 protocol. It's been tested against RabbitMQ. The library was used for the PHP

php-amqplib 4.2k Jan 3, 2023
kafka php client

Kafka-php 中文文档 Kafka-php is a pure PHP kafka client that currently supports greater than 0.8.x version of Kafka, this project v0.2.x and v0.1.x are in

Weibo Ad Platform Open Source 1.4k Jan 5, 2023
Artax is an asynchronous HTTP client for PHP based on Amp

Artax is an asynchronous HTTP client for PHP based on Amp. Its API simplifies standards-compliant HTTP resource traversal and RESTful web service consumption without obscuring the underlying protocol. The library manually implements HTTP over TCP sockets; as such it has no dependency on ext/curl.

AMPHP 21 Dec 14, 2022
Grpc go-server php-client

Grpc go-server php-client

凯 1 Jan 24, 2022