All Connectors
SingleStore Data Connector
SingleStore Data Connector
SingleStore Data Connector
The Hasura SingleStore Connector enables you to connect to a SingleStore database and gives instant access to a GraphQL API on top of your data.
About
Version
Released
September 2, 2024
Last Updated
October 10, 2024
GitHub Repo

SingleStore Data Connector

Docs ndc-hub License Status

The Hasura SingleStore Connector ("the connector") enables you to connect to a SingleStore database and gives instant access to a GraphQL API on top of your data.

This connector is built using the Typescript Data Connector SDK and, it implements the Data Connector Spec.

Features

The following matrix lists the features supported by the Hasura SingleStore connector:

FeatureSupportedNotes
Native Queries + Logical Models
Simple Object Query
Filter / Search
Simple Aggregation
Sort
Paginate
Table Relationships
Views
Distinct
Remote Relationships
Mutationscoming soon

Prerequisites

  1. Create a Hasura Cloud account
  2. Please ensure you have the DDN CLI and Docker installed
  3. Create a supergraph
  4. Create a subgraph
  5. An active SingleStore deployment that serves as the data source for the API.

The steps below explain how to initialize and configure a connector on your local machine (typically for development purposes).You can learn how to deploy a connector to Hasura DDN — after it's been configured — here.

Using the SingleStore connector

With the context set for an existing subgraph, initialize the connector:

ddn connector init -i

When the wizard runs, you'll be prompted to enter the following env vars necessary for your connector to function:

NameDefaultDescription
SINGLESTORE_HOSTlocalhostHostname of the SingleStore database to connect with.
SINGLESTORE_PORT3306Port number of the SingleStore database.
SINGLESTORE_USERSingleStore user to authenticate as.
SINGLESTORE_PASSWORDPassword of the SingleStore database user.
SINGLESTORE_DATABASEName of the SingleStore database to connect with.
SINGLESTORE_SSL_CACA certificate.
SINGLESTORE_SSL_CERTCertificate chain in PEM format.
SINGLESTORE_SSL_KEYPrivate key in PEM format.
SINGLESTORE_SSL_CIPHERSCipher suite specification. If specified, it replaces the default value.
SINGLESTORE_SSL_PASSPHRASEShared passphrase used for a single private key.
SINGLESTORE_SSL_REJECT_UNAUTHORIZEDtrueIf enabled, the server rejects any connection that is not authorized with the list of supplied CAs.

The connector uses MySQL2 library to establish a connection. For more information, refer to Connection options and Pool options.

After the CLI initializes the connector, you'll need to:

Note

SingleStore does not support foreign keys. Relationships between tables must be added manually. You can define relationships by appending relationship information to the .hml files generated in the previous step. For information on defining relationships, refer to Relationships. For example, to add a relationship from a message table to the user table, append following text to the DbMessage.hml file:

---
kind: Relationship
version: v1
definition:
  name: user
  sourceType: DbMessage
  target:
    model:
      name: DbUser
      subgraph: app
      relationshipType: Object
  mapping:
    - source:
        fieldPath:
          - fieldName: userId
      target:
        modelField:
          - fieldName: id
  description: The user details for a message

License

The SingleStore connector is available under the Apache License 2.0.

2024 Edition

The GraphQL Handbook

A GraphQL Handbook for developers and architects to help plan your GraphQL adoption journey.
The GraphQL Handbook

Ship a rock-solid API on your data – in minutes!