Download the PHP package slicingdice/slicingdice without Composer
On this page you can find all versions of the php package slicingdice/slicingdice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download slicingdice/slicingdice
More information about slicingdice/slicingdice
Files in slicingdice/slicingdice
Package slicingdice
Short Description Official PHP client for SlicingDice, Data Warehouse and Analytics Database as a Service.
License MIT
Homepage https://github.com/SlicingDice/slicingdice-php
Informations about the package slicingdice
SlicingDice Official PHP Client (v2.1.0)
Official PHP client for SlicingDice - Data Warehouse and Analytics Database as a Service.
SlicingDice is a serverless, SQL & API-based, easy-to-use and really cost-effective alternative to Amazon Redshift and Google BigQuery.
Build Status:
Code Quality:
Documentation
If you are new to SlicingDice, check our quickstart guide and learn to use it in 15 minutes.
Please refer to the SlicingDice official documentation for more information on how to create a database, how to insert data, how to make queries, how to create columns, SlicingDice restrictions and API details.
Tests and Examples
Whether you want to test the client installation or simply check more examples on how the client works, take a look at tests and examples directory.
Installing
In order to install the PHP client, add the following excerpt to your composer.json
file.
Install the dependencies by executing the command below:
Troubleshooting
If you have problem to install on Linux, try to install these system dependencies:
Usage
The following code snippet is an example of how to add and query data
using the SlicingDice PHP client. We entry data informing
[email protected]
has age 22 and then query the database for
the number of users with age between 20 and 40 years old.
If this is the first register ever entered into the system,
the answer should be 1.
Reference
SlicingDice
encapsulates logic for sending requests to the API. Its methods are thin layers around the API endpoints, so their parameters and return values are JSON-like Object
objects with the same syntax as the API endpoints
Attributes
$key (array)
- API key to authenticate requests with the SlicingDice API.$timeout (int)
- Amount of time, in seconds, to wait for results for each request.
Constructor
_construct($key, $timeout=60)
$key (array)
- API key to authenticate requests with the SlicingDice API.$timeout (int)
- Amount of time, in seconds, to wait for results for each request.
getDatabase()
Get information about current database. This method corresponds to a GET
request at /database
.
Request example
Output example
getColumns()
Get all created columns, both active and inactive ones. This method corresponds to a GET request at /column.
Request example
Output example
createColumn($jsonData)
Create a new column. This method corresponds to a POST request at /column.
Request example
Output example
insert($jsonData)
Insert data to existing entities or create new entities, if necessary. This method corresponds to a POST request at /insert.
Request example
Output example
existsEntity($ids, $dimension)
Verify which entities exist in a dimension (uses default
dimension if not provided) given a list of entity IDs. This method corresponds to a POST request at /query/exists/entity.
Request example
Output example
countEntityTotal()
Count the number of inserted entities in the whole database. This method corresponds to a POST request at /query/count/entity/total.
Request example
Output example
countEntityTotal($dimensions)
Count the total number of inserted entities in the given dimensions. This method corresponds to a POST request at /query/count/entity/total.
Request example
Output example
countEntity($jsonData)
Count the number of entities matching the given query. This method corresponds to a POST request at /query/count/entity.
Request example
Output example
countEvent($jsonData)
Count the number of occurrences for time-series events matching the given query. This method corresponds to a POST request at /query/count/event.
Request example
Output example
topValues($jsonData)
Return the top values for entities matching the given query. This method corresponds to a POST request at /query/top_values.
Request example
Output example
aggregation($jsonData)
Return the aggregation of all columns in the given query. This method corresponds to a POST request at /query/aggregation.
Request example
Output example
getSavedQueries()
Get all saved queries. This method corresponds to a GET request at /query/saved.
Request example
Output example
createSavedQuery($jsonData)
Create a saved query at SlicingDice. This method corresponds to a POST request at /query/saved.
Request example
Output example
updateSavedQuery($queryName, $jsonData)
Update an existing saved query at SlicingDice. This method corresponds to a PUT request at /query/saved/QUERY_NAME.
Request example
Output example
getSavedQuery($queryName)
Executed a saved query at SlicingDice. This method corresponds to a GET request at /query/saved/QUERY_NAME.
Request example
Output example
deleteSavedQuery($queryName)
Delete a saved query at SlicingDice. This method corresponds to a DELETE request at /query/saved/QUERY_NAME.
Request example
Output example
result($jsonData)
Retrieve inserted values for entities matching the given query. This method corresponds to a POST request at /data_extraction/result.
Request example
Output example
score($jsonData)
Retrieve inserted values as well as their relevance for entities matching the given query. This method corresponds to a POST request at /data_extraction/score.
Request example
Output example
sql($query)
Retrieve inserted values using a SQL syntax. This method corresponds to a POST request at /query/sql.