PHPackages                             loranger/questdb-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. loranger/questdb-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

loranger/questdb-client
=======================

Simple PHP QuestDB client using Influx Line Protocol

1.0.0(2y ago)491MITPHPPHP &gt;=7

Since Mar 9Pushed 2y ago2 watchersCompare

[ Source](https://github.com/loranger/QuestDB-PHP-Client)[ Packagist](https://packagist.org/packages/loranger/questdb-client)[ RSS](/packages/loranger-questdb-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

QuestDB wrapper
===============

[](#questdb-wrapper)

Simple PHP [QuestDB](https://questdb.io/) PHP client using Influx Line Protocol.

Formats [ILP query string](https://docs.influxdata.com/influxdb/cloud/reference/syntax/line-protocol/) regarding [QuestDB datatypes](https://questdb.io/docs/reference/api/ilp/advanced-settings/#syntax) provided

Requirements
------------

[](#requirements)

PHP 7+ server with `sockets` extension enabled.

Install
-------

[](#install)

Clone this repository or use composer

```
composer require loranger/questdb-client
```

Usage
-----

[](#usage)

`\QuestDB\Client` wrapper is provided as a singleton class.

### Server config

[](#server-config)

Call the `setServer` method to define your QuestDB host.

```
\QuestDB\Client::setServer('questdb_server', 9009);
```

### Sending datas

[](#sending-datas)

You can send datas to your QuestDB server using the `ping` method, by providing an [ILP](https://questdb.io/docs/reference/api/ilp/advanced-settings/#syntax) query string or an associative array

#### ILP syntax

[](#ilp-syntax)

Use the [ILP syntax](https://questdb.io/docs/reference/api/ilp/advanced-settings/#syntax) to send your datas

```
\QuestDB\Client::ping('trades,symbol=BTC-USD,side=sell');
```

#### ILP Query Builder

[](#ilp-query-builder)

You can use the ILP Query Builder to generate query string from array values

```
new \QuestDB\ILPQueryBuilder(string $table, array $values, int $timestamp = null);
```

```
$ilp_query = new \QuestDB\ILPQueryBuilder('trades', [
    'symbol' => 'BTC-USD',
    'side' => 'sell'
]);

echo $ilp_query;
// trades,symbol=BTC-USD,side=sell

\QuestDB\Client::ping($ilp_query);
```

The `ping` method is compliant with the `ILPQueryBuilder` constructor signature, so you can directly pass the argument to the `ping` method

```
\QuestDB\Client::ping('trades', [
    'symbol' => 'BTC-USD',
    'side' => 'sell'
], time());
```

The given values are automatically considered as symbol datatypes, but you can specify any [QuestDB type](https://questdb.io/docs/reference/api/ilp/columnset-types/) if you need more precision:

```
\QuestDB\Client::ping('trips', [
    'cab_type:symbol' => 'yellow',
    'passenger_count:int' => 3,
    'trip_distance:double' => 6.3,
    'payment_type' => 'cash',
]);
```

which will build the same IPL query as

```
echo (new \QuestDB\ILPQueryBuilder('trips', [
    'cab_type:symbol' => 'yellow',
    'passenger_count:int' => 3,
    'trip_distance:double' => 6.3,
    'payment_type' => 'cash',
]));

// trips,cab_type=yellow,payment_type=cash passenger_count=3i,trip_distance=6.300000
```

Docker
------

[](#docker)

A docker compose file is provided in order to run a local short demo along with a questdb server.

The container is composed by:

- a php 7 image (locally build with its sockets extensions)
- a composer image inherited from php image
- a pest image inherited from php image
- a [dockerized questdb server](https://questdb.io/docs/deployment/docker/)

The PHP image runs [the builtin server](https://www.php.net/manual/en/features.commandline.webserver.php) and expose the port `80` (but can also be used with traefik).

The composer image should exit as soon as the container starts. It only provides a convenient shortcut to run composer command within the container: `docker-compose run --rm composer show --platform`

The pest image is a shortcut to the composer locally installed pest binary. It provides a shortcut to run tests: `docker-compose run --rm pest --version`

The questdb image runs the latest official docker image and exposes ports `9000` and `9009` (but can also be used with traefik).

```
cp .env.example .env
cp docker-compose.example docker-compose.yml
docker compose up
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

800d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3fa4f75f9e746d1f0516bc22652012eccec88c85f440ec2bdd0600f89effa0f?d=identicon)[loranger](/maintainers/loranger)

---

Top Contributors

[![loranger](https://avatars.githubusercontent.com/u/6014?v=4)](https://github.com/loranger "loranger (4 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/loranger-questdb-client/health.svg)

```
[![Health](https://phpackages.com/badges/loranger-questdb-client/health.svg)](https://phpackages.com/packages/loranger-questdb-client)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
