UNPKG

plyql

Version:

A SQL-like interface for Plywood

20 lines (19 loc) 991 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fs = require("fs"); var path = require("path"); var plywood_1 = require("plywood"); exports.getData = function (name) { try { return JSON.parse(fs.readFileSync(path.join(__dirname, "../assets/mysql-static-data/" + name + ".json"), 'utf-8')); } catch (e) { throw new Error("Could not read data for " + name + ": " + e.message); } }; exports.getDataset = function (name) { return plywood_1.Dataset.fromJS(exports.getData(name)); }; exports.getCharacterSetsDataset = function () { return exports.getDataset('character-sets'); }; exports.getCollationsDataset = function () { return exports.getDataset('collations'); }; exports.getKeyColumnUsageDataset = function () { return exports.getDataset('key-column-usage'); }; exports.getIndexDataset = function () { return exports.getDataset('index'); }; exports.getWarningsDataset = function () { return exports.getDataset('warnings'); };