2.3.0 • Published 12 days ago

@sqlframes/repl-app v2.3.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
12 days ago

SQL Frames - REPL App

SQL Frames provides low-code API to transform dataframes using familiar SQL constructs. The built-in in-memory analytics engine runs within the browser allowing data transformations right within the browser providing milli-seconds latency interactions. It allows off-loading computation from the database to the end user browser bringing cost savings to expensive cloud databases and at the same time improving productivity and user experience to end users letting them explore data with ease and gain better business insights.

This package bundles the SQL Frames low-code API along with a REPL application that can be used to interactively load data, perform data transformations and create powerful visualizations such as pivot tables and charts.

This README provides a quick introduction to the REPL application. Visit SQL Frames API to learn the API.

The REPL contains input and output sections referred to as STDIN and STDOUT.

STDIN

STDIN is provided using the monaco editor. Any valid JavaScript can be specified. Any value that needs to be displayed should be explicitly returned. For example,

const df = DataFrame.fromURL('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.csv');
const { groupBy, agg: { max }, where: { eq }} = SQL;
return df.gdf(groupBy('type'),max('mag'));

STDOUT

Any returned value will be displayed in the STDOUT. The return values are displayed as follows

  1. Individual values are displayed using a viewer specific to the type (class) of that value if available. For example, all the Data Frames in SQL Frames have a viewer that can display data in tabular format.
  2. An array is displayed top to bottom with the elemenst stacked vertically.
  3. A JavaScript object (e.g: { x : 42 } ) is displayed with the field names as tabs each containing the corresponding field value.

It is possible to nest arrays and objects to create complex UI.

Special Variables

  1. S - Scratch

Even though this is called REPL, it doesn't provide a LOOP to repeatedly evaluate code. Instead, the existing code needs to be replaced with new code and re-executed. Sometimes it is desirable to retain the values computed for subsequent execution. It is possible to store any value into a special variable called S (for scratch). For example, a DataFrame based on remote data can be fetched once and stored so it is available for subsequent data exploration. For example, the above code is rewritten to make use of storing the Data Frame as a scratch variable for subsequent evaluation.

if(!S.df) {
	const df = DataFrame.fromURL('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.csv');
	S.df = df;
}
const df = S.df;
const { groupBy, agg: { max }, where: { eq }} = SQL;
return df.gdf(groupBy('type'),max('mag'));
  1. C - Cell

The C variable provides some utility functions.

i. C.NONE can be returned to display nothing.

ii. await C.delay(milliseconds,value) can be used to delay certain amount of time and then optionally return a value.

iii. C.md can be used to display markup.

return C.md`Hello **SQL Frames**`
2.3.0

12 days ago

2.2.0

19 days ago

2.1.1

4 months ago

2.1.0

4 months ago

2.0.2

4 months ago

2.0.1

5 months ago

1.0.7

8 months ago

1.0.6

10 months ago

2.0.0-alpha.3

5 months ago

2.0.0-alpha.0

6 months ago

2.0.0-alpha.1

6 months ago

2.0.0-alpha.2

6 months ago

2.0.0

5 months ago

1.0.5

10 months ago

1.0.2

12 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-alpha.2

1 year ago

1.0.0-beta.2

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.4

1 year ago

1.0.0-beta.0

1 year ago

1.0.0-beta.1

1 year ago

1.0.0-alpha.1

1 year ago

1.0.0-alpha.0

1 year ago

0.13.13

1 year ago

0.13.6

1 year ago

0.13.7

1 year ago

0.13.8

1 year ago

0.13.9

1 year ago

0.13.12

1 year ago

0.13.11

1 year ago

0.13.10

1 year ago

0.13.0

2 years ago

0.13.1

2 years ago

0.13.2

2 years ago

0.13.3

2 years ago

0.13.4

1 year ago

0.13.5

1 year ago

0.12.10

2 years ago

0.12.11

2 years ago

0.12.8

2 years ago

0.12.9

2 years ago

0.12.12

2 years ago

0.12.7

2 years ago

0.12.0

2 years ago

0.12.1

2 years ago

0.12.2

2 years ago

0.12.3

2 years ago

0.12.4

2 years ago

0.12.5

2 years ago

0.12.6

2 years ago

0.11.11

2 years ago

0.11.12

2 years ago

0.11.13

2 years ago

0.11.8

2 years ago

0.11.9

2 years ago

0.11.6

2 years ago

0.11.7

2 years ago

0.11.10

2 years ago

0.11.1

2 years ago

0.11.2

2 years ago

0.11.3

2 years ago

0.11.4

2 years ago

0.11.5

2 years ago

0.11.0

2 years ago

0.10.11

2 years ago

0.10.12

2 years ago

0.10.9

2 years ago

0.10.10

2 years ago

0.10.8

2 years ago

0.10.7

2 years ago

0.10.6

2 years ago

0.10.5

2 years ago

0.10.4

2 years ago

0.10.3

2 years ago

0.10.2

2 years ago

0.10.1

2 years ago