SlicingDice Documentation

SlicingDice - The All-in-One Solution Documentation

Welcome to the SlicingDice documentation. You'll find comprehensive guides and documentation to help you start working with SlicingDice as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

7. Query the Database

You have already inserted some data on your database, so now it's time to start leveraging one of the biggest powers of the database: the blazing fast queries.

As mentioned before, SlicingDice gives you three different methods to interact with your databases:

  • The JDBC, ODBC and ADO.NET SQL Drivers.
  • The API-based SQL Endpoint.
  • The API-based JSON Endpoint.

These methods allow you to query data, using standard SQL (on the SQL Drivers and SQL Endpoint) or JSON requests (on our API-based methods). Below you are going to see examples for all the methods we support.


Querying using SQL Drivers

JDBC Driver

Download

You can download the JDBC driver by clicking on this link.

Connection Instructions

To connect to JDBC Driver you can use any SQL Client or any language that supports JDBC. You only need to add the driver to the classpath and provide the following connection string:

jdbc:slicingdice:APIKeys=DATABASE_KEY_OR_CUSTOM_DATABASE_KEY;

Connection String Options

The JDBC driver has a lot of connection string options that you can use to customize your JDBC experience, below you can find the most important ones.

  • Logfile - The path to the log file, with the log file you can find the translations made by the driver and debug if any error occur;
  • Verbosity - The log verbosity, you can set a value between 1 and 5 where 1 is the lower verbosity and 5 the higher.

You can find all the connection string options on the JDBC Driver documentation.

Usage Instructions

The SlicingDice supports the SQL-92 insertions and queries so you can use the pure SQL to make queries and insertions using our driver. To learn more about the SQL compliance you can check the driver documentation.


ODBC Driver

Download

You can download the ODBC driver by clicking on this link.

Connection Instructions

To connect to the ODBC Driver you can follow the instructions for your operating system on the official ODBC documentation.

Connection String Options

The ODBC driver has a lot of connection string options that you can use to customize your ODBC experience, below you can find the most important ones.

  • Logfile - The path to the log file, with the log file you can find the translations made by the driver and debug if any error occur;
  • Verbosity - The log verbosity, you can set a value between 1 and 5 where 1 is the lower verbosity and 5 the higher.

You can find all the connection string options on the ODBC Driver documentation.

Usage Instructions

The SlicingDice supports the SQL-92 insertions and queries so you can use the pure SQL to make queries and insertions using our driver. To learn more about the SQL compliance you can check the driver documentation.


ADO.NET Driver

Download

You can download the ADO.net driver by clicking on this link.

Connection Instructions

To connect to the ADO.net Driver you can follow the instruction on the official ADO.net Driver documentation.

Connection String Options

The ADO.net driver has a lot of connection string options that you can use to customize your ADO.net experience, below you can find the most important ones.

  • Logfile - The path to the log file, with the log file you can find the translations made by the driver and debug if any error occur;
  • Verbosity - The log verbosity, you can set a value between 1 and 5 where 1 is the lower verbosity and 5 the higher.

You can find all the connection string options on the ADO.net Driver documentation.

Usage Instructions

The SlicingDice supports the SQL-92 insertions and queries so you can use the pure SQL to make queries and insertions using our driver. To learn more about the SQL compliance you can check the driver documentation.


Querying using SQL API Endpoint

In addition to the SQL Drivers you can also have access to our SQL Drivers using an API endpoint. Using the SlicingDice SQL this way you don't need to worry on installing and configuring any driver on your machine.

Overview of the SQL-based API endpoint

Watch this quick video below to learn more about the SQL-based API endpoint.

Using the SQL-based SQL Endpoint

To use the SQL-based API you need to make requests to a specific endpoint on the API, the https://api.slicingdice.com/v1/sql endpoint. This endpoint only receives POST requests and requires these parameters:

Authorization: Your Database Key received when a new database was created or a demo Database Key;

Content-Type: The Content-Type should be application/sql.

To use the endpoint you simply need to make a request sending the required parameters showed above and a SQL statement on the body of the request. Below you can find some examples.

A simple count entities query that asks how many users live on the California state.

$ curl -X POST https://api.slicingdice.com/v1/sql \
    -H 'Authorization: MASTER_OR_WRITE_API_KEY' \
    -H 'Content-Type: application/sql' \
    -d 'SELECT COUNT([entity-id]) FROM users WHERE state = 'CA';'

Querying using JSON API Endpoint

The database also allows you to make queries using the JSON API endpoint, that supports all types of queries that can be written using SQL, but that sometimes is much simpler and easier to understand than SQL.

Check the Query the Database API documentation page learn how to make queries using the SlicingDice's API.