GitHub PullRequestReviewCommentEvent at 2014-03-19 13:36:20
Repository: interactive-maps
Actor: aquilax
Payload: {"comment":{"url":"https://api.github.com/repos/Wikia/interactive-maps/pulls/comments/10748771","id":10748771,"diff_hunk":"@@ -0,0 +1,75 @@\n+/**\n+ *  Module for connection with database, building and making queries.\n+ *  Knex is used as DB connector.\n+ */\n+\n+var Knex = require('knex'),\n+\tconfig = require('./config'),\n+\tknex;\n+\n+// initialize database connection\n+Knex.knex = Knex.initialize({\n+\tclient: 'mysql',\n+\tconnection: config.db\n+});\n+\n+knex = Knex.knex;\n+\n+/**\n+ * @desc function for creating SELECT query\n+ * @param table {string} - table name\n+ * @param columns {array} - table columns\n+ * @param where {object} - object with WHERE query params\n+ * @returns {object} - query object which could be executed as a promise with .then() or with callback using .exec()\n+ */\n+\n+function sel(table, columns, where) {\n+\tvar query = knex(table).column(columns);\n+\n+\tif (where) {\n+\t\tquery.where(where);\n+\t}\n+\n+\treturn query.select();\n+}\n+\n+/**\n+ * @desc function for creating INSERT query\n+ * @param table {string} - table name\n+ * @param data {object} - JSON object with data to be inserted\n+ * @returns {object} - query object which could be executed as a promise with .then() or with callback using .exec()\n+ */\n+\n+function ins(table, data) {\n+\treturn knex(table).insert(data);\n+}\n+\n+/**\n+ * @desc function for creating DELETE query\n+ * @param table {string} - table name\n+ * @param where {object} - JSON object with WHERE params\n+ * @returns {object} - query object which could be executed as a promise with .then() or with callback using .exec()\n+ */\n+\n+function del(table, where) {","path":"lib/db_connector.js","position":54,"original_position":54,"commit_id":"42519882b40781f2e9808c91faf4164f449590e1","original_commit_id":"42519882b40781f2e9808c91faf4164f449590e1","user":{"login":"aquilax","id":328067,"avatar_url":"https://avatars.githubusercontent.com/u/328067?","gravatar_id":"8cf592a20de754300721bf954aa40507","url":"https://api.github.com/users/aquilax","html_url":"https://github.com/aquilax","followers_url":"https://api.github.com/users/aquilax/followers","following_url":"https://api.github.com/users/aquilax/following{/other_user}","gists_url":"https://api.github.com/users/aquilax/gists{/gist_id}","starred_url":"https://api.github.com/users/aquilax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquilax/subscriptions","organizations_url":"https://api.github.com/users/aquilax/orgs","repos_url":"https://api.github.com/users/aquilax/repos","events_url":"https://api.github.com/users/aquilax/events{/privacy}","received_events_url":"https://api.github.com/users/aquilax/received_events","type":"User","site_admin":false},"body":"Same as in `sel`;","created_at":"2014-03-19T13:36:20Z","updated_at":"2014-03-19T13:36:20Z","html_url":"https://github.com/Wikia/interactive-maps/pull/7#discussion_r10748771","pull_request_url":"https://api.github.com/repos/Wikia/interactive-maps/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/Wikia/interactive-maps/pulls/comments/10748771"},"html":{"href":"https://github.com/Wikia/interactive-maps/pull/7#discussion_r10748771"},"pull_request":{"href":"https://api.github.com/repos/Wikia/interactive-maps/pulls/7"}}}}