{"action":"closed","issue":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/353","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/353/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/353/comments","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/353/events","html_url":"https://github.com/strongloop/loopback-datasource-juggler/issues/353","id":48731368,"number":353,"title":"DataSource discoverSchema doesn't fire callback if table was not found ","user":{"login":"Jeff-Lewis","id":676289,"avatar_url":"https://avatars.githubusercontent.com/u/676289?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeff-Lewis","html_url":"https://github.com/Jeff-Lewis","followers_url":"https://api.github.com/users/Jeff-Lewis/followers","following_url":"https://api.github.com/users/Jeff-Lewis/following{/other_user}","gists_url":"https://api.github.com/users/Jeff-Lewis/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeff-Lewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeff-Lewis/subscriptions","organizations_url":"https://api.github.com/users/Jeff-Lewis/orgs","repos_url":"https://api.github.com/users/Jeff-Lewis/repos","events_url":"https://api.github.com/users/Jeff-Lewis/events{/privacy}","received_events_url":"https://api.github.com/users/Jeff-Lewis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2014-11-14T05:04:52Z","updated_at":"2015-02-05T21:55:08Z","closed_at":"2015-02-05T21:55:08Z","body":"Using the mssql connector:\r\n\r\n``` javascript\r\nthis.discoverSchemas(modelName, options, function (err, schemas) {\r\n    if (err) {\r\n      cb && cb(err, schemas);\r\n      return;\r\n    }\r\n    for (var s in schemas) {\r\n      cb && cb(null, schemas[s]);\r\n      return;\r\n    }\r\n  });\r\n```\r\n\r\nIf both *err* and *schemas* are undefined, *cb* will never be called nor does the function return anything.\r\n\r\n[Code can be found here.](https://github.com/strongloop/loopback-datasource-juggler/blob/master/lib/datasource.js#L1166-1169)\r\n\r\n(This issue was originally put in the wrong repo)"}}