{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/comments/68671832","id":68671832,"diff_hunk":"@@ -0,0 +1,136 @@\n+// ----------------------------------------------------------------------------\n+// Copyright (c) Microsoft Corporation. All rights reserved.\n+// ----------------------------------------------------------------------------\n+\n+/**\n+ * @file Helper functions for performing store related operations\n+ */\n+\n+var idPropertyName = require('../../constants').table.idPropertyName,\n+    Validate = require('../../Utilities/Validate');\n+\n+/**\n+ * Validates the table definition\n+ */\n+function validateTableDefinition(tableDefinition) {\n+    // Do basic table name validation and leave the rest to the store\n+    Validate.notNull(tableDefinition, 'tableDefinition');\n+    Validate.isObject(tableDefinition, 'tableDefinition');\n+\n+    Validate.isString(tableDefinition.name, 'tableDefinition.name');\n+    Validate.notNullOrEmpty(tableDefinition.name, 'tableDefinition.name');\n+\n+    // Validate the specified column types and check for duplicate columns\n+    var columnDefinitions = tableDefinition.columnDefinitions,\n+        definedColumns = {};\n+    \n+    Validate.isObject(columnDefinitions);\n+    Validate.notNull(columnDefinitions);\n+\n+    for (var columnName in columnDefinitions) {\n+\n+        Validate.isString(columnDefinitions[columnName], 'columnType');\n+        Validate.notNullOrEmpty(columnDefinitions[columnName], 'columnType');\n+\n+        if (definedColumns[columnName.toLowerCase()]) {\n+            throw new Error('Duplicate definition for column ' + columnName + '\" in table \"' + tableDefinition.name + '\"');\n+        }\n+\n+        definedColumns[columnName.toLowerCase()] = true;\n+    }\n+}\n+\n+/**\n+ * Adds a tableDefinition to the tableDefinitions object\n+ */\n+function addTableDefinition(tableDefinitions, tableDefinition) {\n+    Validate.isObject(tableDefinitions);\n+    Validate.notNull(tableDefinitions);\n+    validateTableDefinition(tableDefinition);\n+\n+    tableDefinitions[tableDefinition.name.toLowerCase()] = tableDefinition;\n+}\n+\n+/**\n+ * Gets the table definition for the specified table name from the tableDefinitions object\n+ */\n+function getTableDefinition(tableDefinitions, tableName) {\n+    Validate.isObject(tableDefinitions);\n+    Validate.notNull(tableDefinitions);\n+    Validate.isString(tableName);\n+    Validate.notNullOrEmpty(tableName);\n+\n+    var tableDefinition = tableDefinitions[tableName.toLowerCase()];\n+\n+    if (tableDefinition) {","path":"sdk/src/Platforms/cordova/storeHelper.js","position":65,"original_position":65,"commit_id":"e48114dabdf80ab7a7d83dabc0b9eeb3ddc129e1","original_commit_id":"e48114dabdf80ab7a7d83dabc0b9eeb3ddc129e1","user":{"login":"shrishrirang","id":11167859,"avatar_url":"https://avatars.githubusercontent.com/u/11167859?v=3","gravatar_id":"","url":"https://api.github.com/users/shrishrirang","html_url":"https://github.com/shrishrirang","followers_url":"https://api.github.com/users/shrishrirang/followers","following_url":"https://api.github.com/users/shrishrirang/following{/other_user}","gists_url":"https://api.github.com/users/shrishrirang/gists{/gist_id}","starred_url":"https://api.github.com/users/shrishrirang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrishrirang/subscriptions","organizations_url":"https://api.github.com/users/shrishrirang/orgs","repos_url":"https://api.github.com/users/shrishrirang/repos","events_url":"https://api.github.com/users/shrishrirang/events{/privacy}","received_events_url":"https://api.github.com/users/shrishrirang/received_events","type":"User","site_admin":false},"body":"haha yes. WIll fix it. There was a throw 'table definition not found' after that which I removed before CR :)","created_at":"2016-06-27T23:01:00Z","updated_at":"2016-06-27T23:01:00Z","html_url":"https://github.com/Azure/azure-mobile-apps-js-client/pull/151#discussion_r68671832","pull_request_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/comments/68671832"},"html":{"href":"https://github.com/Azure/azure-mobile-apps-js-client/pull/151#discussion_r68671832"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151","id":75387215,"html_url":"https://github.com/Azure/azure-mobile-apps-js-client/pull/151","diff_url":"https://github.com/Azure/azure-mobile-apps-js-client/pull/151.diff","patch_url":"https://github.com/Azure/azure-mobile-apps-js-client/pull/151.patch","issue_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/issues/151","number":151,"state":"open","locked":false,"title":"Make table and column names case insensitive","user":{"login":"shrishrirang","id":11167859,"avatar_url":"https://avatars.githubusercontent.com/u/11167859?v=3","gravatar_id":"","url":"https://api.github.com/users/shrishrirang","html_url":"https://github.com/shrishrirang","followers_url":"https://api.github.com/users/shrishrirang/followers","following_url":"https://api.github.com/users/shrishrirang/following{/other_user}","gists_url":"https://api.github.com/users/shrishrirang/gists{/gist_id}","starred_url":"https://api.github.com/users/shrishrirang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrishrirang/subscriptions","organizations_url":"https://api.github.com/users/shrishrirang/orgs","repos_url":"https://api.github.com/users/shrishrirang/repos","events_url":"https://api.github.com/users/shrishrirang/events{/privacy}","received_events_url":"https://api.github.com/users/shrishrirang/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-27T21:59:07Z","updated_at":"2016-06-27T23:01:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"210ee30a171833f6ebd5c3d8e8384e29c19a32eb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/issues/151/comments","statuses_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/statuses/e48114dabdf80ab7a7d83dabc0b9eeb3ddc129e1","head":{"label":"shrishrirang:case","ref":"case","sha":"e48114dabdf80ab7a7d83dabc0b9eeb3ddc129e1","user":{"login":"shrishrirang","id":11167859,"avatar_url":"https://avatars.githubusercontent.com/u/11167859?v=3","gravatar_id":"","url":"https://api.github.com/users/shrishrirang","html_url":"https://github.com/shrishrirang","followers_url":"https://api.github.com/users/shrishrirang/followers","following_url":"https://api.github.com/users/shrishrirang/following{/other_user}","gists_url":"https://api.github.com/users/shrishrirang/gists{/gist_id}","starred_url":"https://api.github.com/users/shrishrirang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrishrirang/subscriptions","organizations_url":"https://api.github.com/users/shrishrirang/orgs","repos_url":"https://api.github.com/users/shrishrirang/repos","events_url":"https://api.github.com/users/shrishrirang/events{/privacy}","received_events_url":"https://api.github.com/users/shrishrirang/received_events","type":"User","site_admin":false},"repo":{"id":61664307,"name":"azure-mobile-apps-js-client","full_name":"shrishrirang/azure-mobile-apps-js-client","owner":{"login":"shrishrirang","id":11167859,"avatar_url":"https://avatars.githubusercontent.com/u/11167859?v=3","gravatar_id":"","url":"https://api.github.com/users/shrishrirang","html_url":"https://github.com/shrishrirang","followers_url":"https://api.github.com/users/shrishrirang/followers","following_url":"https://api.github.com/users/shrishrirang/following{/other_user}","gists_url":"https://api.github.com/users/shrishrirang/gists{/gist_id}","starred_url":"https://api.github.com/users/shrishrirang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrishrirang/subscriptions","organizations_url":"https://api.github.com/users/shrishrirang/orgs","repos_url":"https://api.github.com/users/shrishrirang/repos","events_url":"https://api.github.com/users/shrishrirang/events{/privacy}","received_events_url":"https://api.github.com/users/shrishrirang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shrishrirang/azure-mobile-apps-js-client","description":"Javascript Clients for Azure Mobile Apps","fork":true,"url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client","forks_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/forks","keys_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/teams","hooks_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/hooks","issue_events_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/issues/events{/number}","events_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/events","assignees_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/assignees{/user}","branches_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/branches{/branch}","tags_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/tags","blobs_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/statuses/{sha}","languages_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/languages","stargazers_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/stargazers","contributors_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/contributors","subscribers_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/subscribers","subscription_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/subscription","commits_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/contents/{+path}","compare_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/merges","archive_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/downloads","issues_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/issues{/number}","pulls_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/pulls{/number}","milestones_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/milestones{/number}","notifications_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/labels{/name}","releases_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/releases{/id}","deployments_url":"https://api.github.com/repos/shrishrirang/azure-mobile-apps-js-client/deployments","created_at":"2016-06-21T20:17:49Z","updated_at":"2016-06-21T20:17:51Z","pushed_at":"2016-06-27T22:53:27Z","git_url":"git://github.com/shrishrirang/azure-mobile-apps-js-client.git","ssh_url":"git@github.com:shrishrirang/azure-mobile-apps-js-client.git","clone_url":"https://github.com/shrishrirang/azure-mobile-apps-js-client.git","svn_url":"https://github.com/shrishrirang/azure-mobile-apps-js-client","homepage":null,"size":3553,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"34b9be55a4432af78501b3028b728790aa89ca0b","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":46444073,"name":"azure-mobile-apps-js-client","full_name":"Azure/azure-mobile-apps-js-client","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-mobile-apps-js-client","description":"Javascript Clients for Azure Mobile Apps","fork":false,"url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client","forks_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/forks","keys_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/teams","hooks_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/events","assignees_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/tags","blobs_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/subscription","commits_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/merges","archive_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/downloads","issues_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/deployments","created_at":"2015-11-18T20:03:45Z","updated_at":"2016-06-14T08:24:35Z","pushed_at":"2016-06-27T21:59:07Z","git_url":"git://github.com/Azure/azure-mobile-apps-js-client.git","ssh_url":"git@github.com:Azure/azure-mobile-apps-js-client.git","clone_url":"https://github.com/Azure/azure-mobile-apps-js-client.git","svn_url":"https://github.com/Azure/azure-mobile-apps-js-client","homepage":null,"size":3562,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":49,"forks":11,"open_issues":49,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151"},"html":{"href":"https://github.com/Azure/azure-mobile-apps-js-client/pull/151"},"issue":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/issues/151"},"comments":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/issues/151/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/pulls/151/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-mobile-apps-js-client/statuses/e48114dabdf80ab7a7d83dabc0b9eeb3ddc129e1"}}}}
{"actor":{"display_login":"shrishrirang"}}