"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.QueryBuilderQueries = undefined;

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _ = require("..");

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var QueryBuilderQueries = function () {
    function QueryBuilderQueries() {
        _classCallCheck(this, QueryBuilderQueries);

        this.collection;
        this.fields = {};
        this.where;
    }

    _createClass(QueryBuilderQueries, [{
        key: "into",
        value: function into(collection) {
            this.collection = collection;
            return this;
        }
    }, {
        key: "from",
        value: function from(collection) {
            this.collection = collection;
            return this;
        }
    }, {
        key: "set",
        value: function set(fields, value) {
            var _this = this;

            if ((typeof fields === "undefined" ? "undefined" : _typeof(fields)) === "object") Object.keys(fields).forEach(function (field) {
                return _this.set(field, fields[field]);
            });else this.fields[fields] = value;

            return this;
        }
    }, {
        key: "where",
        value: function where(_where) {
            this._where = _where;
            return this;
        }
    }, {
        key: "execute",
        value: function execute() {
            return _.Connection.query(this.parse());
        }
    }]);

    return QueryBuilderQueries;
}();

exports.QueryBuilderQueries = QueryBuilderQueries;