How to use iotdb - 10 common examples

To help you get started, we’ve selected a few iotdb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dpjanes / iotdb-iotql / lib / db_create_view.js View on Github external
*
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

"use strict";

var iotdb = require("iotdb");
var _ = require('iotdb-helpers');

var util = require('util');

var logger = iotdb.logger({
    name: 'iotdb-iotql',
    module: 'db_create_view',
});

var DB = require('./db').DB;

/**
 *  CREATE VIEW statement
 */
DB.prototype.run_statement_create_view = function (view_statement, callback) {
    var self = this;

    // get transporter
    var store = view_statement.store || "things";
    var transporter = self.stored[store];
    if (!transporter) {
github dpjanes / iotdb-homestar / app / firebase.js View on Github external
var iotdb = require('iotdb');
var iotdb_transport = require('iotdb-transport');
var _ = iotdb.helpers;

var unirest = require('unirest');
var firebase = require('firebase'); // NOTE: the real thing, not this module
var FirebaseTransport = require('iotdb-transport-firebase').Transport;

var settings = require('./settings');
var recipe = require('./recipe');
var things = require('./things');
var recipe = require('./recipe');
var users = require('./users');

var logger = iotdb.logger({
    name: 'iotdb-homestar',
    module: 'app/firebase',
});

var _firebase = null;
var _cfg = null;

/**
 */
var _connect_iotdb = function () {
    /* check the timestamp */
    var firebase_transporter_check = new FirebaseTransport({
        firebase: _firebase,
        prefix: _cfg.path + "/" + settings.d.keys.homestar.key + "/things",
        add_timestamp: true,
        check_timestamp: true,
github dpjanes / iotdb-homestar / app / interactors.js View on Github external
*/

"use strict";

const iotdb = require('iotdb');
const _ = iotdb._;

const settings = require('./settings');

const events = require('events');
const util = require('util');
const path = require('path');
const fs = require('fs');
const express = require('express');

const logger = iotdb.logger({
    name: 'iotdb-homestar',
    module: 'app/interactors',
});

const htmlsd = {};
const htmld = {};
const moduled = {};

// find the best interactor for an attribute
const interactor = attributed => 
    _.reduce(
        _.pairs(moduled)
            .map(kv => ({ key: kv[0], module: kv[1] }))
            .filter(d => d.module.attribute)
            .map(d => _.d.add(d, "interactor", d.module.attribute(attributed)))
            .filter(d => d.interactor)
github dpjanes / iotdb-homestar / app / homestar.js View on Github external
*  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

"use strict";

const iotdb = require('iotdb');
const _ = iotdb._;

const unirest = require('unirest');

const settings = require('./settings');

const logger = iotdb.logger({
    name: 'iotdb-homestar',
    module: 'app/homestar',
});

var bearer;
var API_ROOT;
var API_CONSUMER;
var API_PING;
var API_PROFILE;

/**
 *  Ping the server that I'm alive
 */
const ping = function () {
    console.log("BEARER", API_PING, bearer);
    unirest
github dpjanes / iotdb-iotql / lib / db_use_view.js View on Github external
*
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

"use strict";

var iotdb = require("iotdb");
var _ = require('iotdb-helpers');

var logger = iotdb.logger({
    name: 'iotdb-iotql',
    module: 'db_use_view',
});

var DB = require('./db').DB;

/**
 *  USE VIEW statement
 */
DB.prototype.run_statement_use_view = function (statement, callback) {
    var self = this;

    self.prevaluate(statement);

    self.variable_set('_use_view', statement['use-view']);
github dpjanes / iotdb-iotql / lib / db_create_scene.js View on Github external
*
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

"use strict";

var iotdb = require("iotdb");
var _ = require('iotdb-helpers');

var logger = iotdb.logger({
    name: 'iotdb-iotql',
    module: 'db_create_scene',
});

var operators = require("./operators");
var typed = require("./typed");
var units = require("./units");
var DB = require('./db').DB;

/**
 *  CREATE SCENE statement
 */
DB.prototype.run_statement_create_scene = function (statement, callback) {
    var self = this;

    self.prevaluate(statement);
github dpjanes / iotdb-iotql / lib / db_create_rule.js View on Github external
*
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

"use strict";

var iotdb = require("iotdb");
var _ = require('iotdb-helpers');

var util = require('util');

var logger = iotdb.logger({
    name: 'iotdb-iotql',
    module: 'db_create_rule',
});

var operators = require("./operators");
var typed = require("./typed");
var units = require("./units");
var DB = require('./db').DB;

var __rule_id = 0;

/**
 *  CREATE RULE statement
 */
DB.prototype.run_statement_create_rule = function (rule_statement, callback) {
    var self = this;
github dpjanes / iotdb-iotql / lib / db_connect_all.js View on Github external
*
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

"use strict";

var iotdb = require("iotdb");
var _ = require('iotdb-helpers');

var logger = iotdb.logger({
    name: 'iotdb-iotql',
    module: 'db_connect_all',
});

var operators = require("./operators");
var typed = require("./typed");
var units = require("./units");
var DB = require('./db').DB;

/**
 *  CONNECT ALL statement
 */
DB.prototype.run_statement_connect_all = function (statement, callback) {
    var self = this;

    iotdb.connect();
github dpjanes / iotdb-homestar / app / helpers.js View on Github external
"use strict";

var iotdb = require('iotdb');
var _ = iotdb.helpers;
var cfg = iotdb.cfg;

var homestar = require('../homestar');
var interactors = require('./interactors');

var fs = require('fs');
var path = require('path');
var util = require('util');

var uuid = require('uuid');

var logger = iotdb.logger({
    name: 'iotdb-homestar',
    module: 'app/helpers',
});

/**
 *  This will edit a file and add UDIDs to Chapters
 *
 *  <p>
 *  This is synchronous
 */
var edit_add_cookbook_ids = function (filename) {
    if (!fs.existsSync(filename)) {
        logger.error({
            method: "edit_add_cookbook_ids",
            filename: filename
        }, "file does not exist");</p>
github dpjanes / iotdb-homestar / app / mqtt.js View on Github external
*  XXX this server / bridge code isn't working
 *  just yet so we're using IOTDB's MQTT server
 */

"use strict";

const iotdb = require('iotdb');
var _ = iotdb._;

const mqtt = require('mqtt');
const mows = require('mows');

const settings = require('./settings');
const auth = require('./auth');

var logger = iotdb.logger({
    name: 'iotdb-homestar',
    module: 'app/mqtt',
});

var serverd = {};
var server_client = function (client) {
    var self = serverd;

    logger.info({
        method: "server_client",
    }, "called");

    if (!self.clients) {
        self.clients = {};
    }

iotdb

IOTDB.org

Apache-2.0
Latest version published 8 years ago

Package Health Score

36 / 100
Full package analysis

Popular iotdb functions