All Projects → cloudingcity → presto-client-php

cloudingcity / presto-client-php

Licence: MIT License
A Presto client for the PHP programming language.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to presto-client-php

presto-chart
Highly configurable Helm Presto Chart
Stars: ✭ 23 (-4.17%)
Mutual labels:  presto, prestodb
Trino
Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
Stars: ✭ 4,581 (+18987.5%)
Mutual labels:  presto, prestodb
nativescript-http
The best way to do HTTP requests in NativeScript, a drop-in replacement for the core HTTP with important improvements and additions like proper connection pooling, form data support and certificate pinning
Stars: ✭ 32 (+33.33%)
Mutual labels:  http-client
incubator-linkis
Linkis helps easily connect to various back-end computation/storage engines(Spark, Python, TiDB...), exposes various interfaces(REST, JDBC, Java ...), with multi-tenancy, high performance, and resource control.
Stars: ✭ 2,459 (+10145.83%)
Mutual labels:  presto
minireq
A minimal request library for the browser
Stars: ✭ 42 (+75%)
Mutual labels:  http-client
http-interceptors
The Web apps in this monorepo make HTTP requests and require uniform consistency in how they are executed and handled. This monorepo demonstrates the same app written with Angular and with Svelte. Each app uses HTTP interceptors. The Angular app uses HttpClient and its interceptors while the Svelte app uses Axios and its interceptors.
Stars: ✭ 46 (+91.67%)
Mutual labels:  http-client
wobbuffetch
Reactive wrapper for Fetch API
Stars: ✭ 28 (+16.67%)
Mutual labels:  http-client
ELWebService
A lightweight HTTP networking framework for Swift
Stars: ✭ 89 (+270.83%)
Mutual labels:  http-client
EthernetWebServer
This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and…
Stars: ✭ 118 (+391.67%)
Mutual labels:  http-client
gohttp
A simple to use golang http client
Stars: ✭ 47 (+95.83%)
Mutual labels:  http-client
go-axios
HTTP Request package for golang.
Stars: ✭ 29 (+20.83%)
Mutual labels:  http-client
fetchx
Beautiful way to fetch data in React
Stars: ✭ 71 (+195.83%)
Mutual labels:  http-client
fetch-wrap
extend WHATWG fetch wrapping it with middlewares
Stars: ✭ 21 (-12.5%)
Mutual labels:  http-client
re-frame-http-fx-alpha
A ClojureScript client library for HTTP requests. Provides a re-frame "effect handler" keyed :http
Stars: ✭ 37 (+54.17%)
Mutual labels:  http-client
monolog-http
A collection of monolog handlers that use a PSR-18 HTTP Client to send your logs
Stars: ✭ 34 (+41.67%)
Mutual labels:  http-client
http4s-dom
http4s, in a browser near you
Stars: ✭ 13 (-45.83%)
Mutual labels:  http-client
rq
A nicer interface for golang stdlib HTTP client
Stars: ✭ 40 (+66.67%)
Mutual labels:  http-client
MultipartEncoder
C++ implementation of encoding HTTP multipart/form-data into a string buffer for POST action in HTTP clients
Stars: ✭ 45 (+87.5%)
Mutual labels:  http-client
googlemaps-services
📍Ruby client library for Google Maps API Web Services
Stars: ✭ 14 (-41.67%)
Mutual labels:  http-client
rif
Power-user command-line tool for productive API developers
Stars: ✭ 17 (-29.17%)
Mutual labels:  http-client

Presto Client PHP

PHPStan

A Presto client for the PHP programming language.

Inspired by illuminate/database

Features

  • Multiple connections define.
  • Get result as an associative array.

Installation

composer require clouding/presto-client-php

Quick Start

Create a presto manager

<?php

use Clouding\Presto\Presto;

$presto = new Presto();

$presto->addConnection([
    'host' => 'localhost:8080',
    'catalog' => 'default',
    'schema' => 'presto',
]);

// Set manager as global (optional)
$presto->setAsGlobal();

Get a default connection and send query

<?php

$posts = $presto->connection()->query('select * from posts')->get();

If set manager as global, just query directly and get data

<?php

$posts = Presto::query('SELECT * FROM posts')->get();
/* 
    [
        [1, 'Good pracetice'],
        [2, 'Make code cleaner'],
    ]
*/

$posts = Presto::query('SELECT * FROM posts')->getAssoc();
/* 
    [
        ['id' => 1, 'title' => 'Good pracetice'],
        ['id' => 2, 'title' => 'Make code cleaner'],
    ]
*/    

Usage

Multiple connections

<?php

use Clouding\Presto\Presto;

$presto = new Presto();

$presto->addConnection([
    'host' => 'localhost:8080',
    'catalog' => 'default',
    'schema' => 'presto',
]);

$presto->addConnection([
    'host' => 'localhost:8080',
    'catalog' => 'default2',
    'schema' => 'presto2',
], 'presto2');

$presto->setAsGlobal();

// Get connections
$connections = Presto::getConnections();

// Specify connection
$posts = Presto::query('SELECT * FROM posts', 'presto2')->get();

Running Tests

composer test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].