Git Product home page Git Product logo

hasura-connector's Introduction

Data Connector Agent for Couchbase

This directory contains a Couchbase implementation of a data connector agent. It can use a Couchbase cluster and consume documents of a bucket as referenced by the "DB" config field.

Capabilities

The Couchbase agent currently supports the following capabilities:

  • GraphQL Schema
  • GraphQL Queries
  • Prometheus Metrics
  • Exposing Foreign-Key Information
  • Mutations
  • Subscriptions
  • Streaming Subscriptions

Note: You can get detailed metadata about the agent's capabilities by GETting the /capabilities endpoint of the running agent.

Requirements

  • NodeJS 16
  • "Couchbase": "^3.2.4"
  • Note: NPM is used for the TS Types for the DC-API protocol
  • Copy .env.example to .env and define your values to environment vars

Options / Environment Variables

Note: Boolean flags {FLAG} can be provided as 1, true, yes, or omitted and default to false.

ENV Variable Name Format Default Info
PORT INT 8100 Port for agent to listen on.
PERMISSIVE_CORS {FLAG} false Allows all requests - Useful for testing with SwaggerUI. Turn off on production.
DEBUGGING_TAGS {FLAG} false Outputs xml style tags in query comments for deugging purposes.
LOG_LEVEL fatal | error | info | debug | trace | silent info The minimum log level to output
METRICS {FLAG} false Enables a /metrics prometheus metrics endpoint.

Agent usage

The agent is configured as per the configuration schema. The valid configuration properties are:

Property Type Default Info
db string Connection string to couchbase cluster
username string User that will be used to connect with cluster
password string Password that will be used to connect with cluster
bucket string Bucket that will be used from DC Agent
scope string default Scope that will be used from DC Agent
collection string default Collection that will be used from DC Agent
healtCheckStrategy string null Strategic to check health of cluster ping or diagnostic

The schema is exposed via introspection, but you can limit which documents are referenced by

Dataset

The dataset used for testing the couchbase agent is sample buckets

  • Travel-sample

Testing Changes to the Agent

Run:

cabal run dc-api:test:tests-dc-api -- test --agent-base-url http://localhost:8100 --agent-config '{"bucket": "travel-sample", "healtCheckStrategy": "ping"}'

From the HGE repo.

TODO

  • Prometheus metrics hosted at /metrics
  • Pull reference types from a package rather than checked-in files
  • Health Check
  • DB Specific Health Checks
  • Schema
  • Capabilities
  • Query

Known Bugs

Tricky Aggregates may have logic bug

Replicate by running the agent test-suite.

hasura-connector's People

Contributors

wenyichen avatar biozal avatar gsoftprop-yoan avatar yoanesp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.