libcast/influx-php
Composer 安装命令:
composer require libcast/influx-php
包简介
Simple client for InfluxDB
README 文档
README
Simple PHP client for InfluxDB, an open-source, distributed, time series, events, and metrics database with no external dependencies.
How to install it
The easiest way is to install it via composer
composer require crodas/influx-php:\*
How to use it
You need to create a client object.
$client = new \crodas\InfluxPHP\Client( "localhost" /*default*/, 8086 /* default */, "root" /* by default */, "root" /* by default */ );
The first time you should create an database.
$db = $client->createDatabase("foobar"); $db->createUser("foo", "bar"); // <-- create user/password
Create data is very simple.
$db = $client->foobar; $db->insert("some label", ['foobar' => 'bar']); // single input $db->insert("some label", [ ['foobar' => 'bar'], ['foobar' => 'foo'], ]); // multiple input, this is better :-)
Now you can get the database object and start querying.
$db = $client->foobar; // OR $db = $client->getDatabase("foobar"); foreach ($db->query("SELECT * FROM foo;") as $row) { var_dump($row, $row->time); }
统计信息
- 总下载量: 6.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-4-Clause
- 更新时间: 2016-04-01