Skip to content

Instantly share code, notes, and snippets.

@mrblueblue
Last active May 29, 2017 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrblueblue/1b054ae67547993744d6515f34f3bd8c to your computer and use it in GitHub Desktop.
Save mrblueblue/1b054ae67547993744d6515f34f3bd8c to your computer and use it in GitHub Desktop.

Table of Contents

Types

Library type definitions are declared in the flow-typed/ folder.

API

The exported module

createDataGraph

Creates a SQL data graph instance.

Parameters

  • connector Connector
  • initialState GraphState (optional, default {})

Returns Graph

writeSQL

Returns a SQL query string based on the DataState passed in.

Parameters

  • state DataState

Returns string

Graph

An instance of a SQL data graph

nodes

Returns all data node instances of the graph.

Returns Array<DataNode>

getState

Returns the state of the graph.

Returns GraphState

data

Creates a data node instance.

Parameters

  • state DataState

Returns DataNode

Data

A node in the graph that represents a set of data transformations.

getState

Returns the state of the data node.

Returns DataState

transform

Sets the transform state of the data node.

Parameters

  • transform (Transform | Array<Transform>)

Returns DataNode

toSQL

Returns the SQL string representation of the set of data transformations the node embodies.

Returns string

values

Executes data node's SQL query representation and returns queried data as a promise.

Returns Promise<Array<any>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment