{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/875","repository_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/875/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/875/comments","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/875/events","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/875","id":141328234,"number":875,"title":"support custom field settings under the connector's namespace","user":{"login":"bitmage","id":312943,"avatar_url":"https://avatars.githubusercontent.com/u/312943?v=3","gravatar_id":"","url":"https://api.github.com/users/bitmage","html_url":"https://github.com/bitmage","followers_url":"https://api.github.com/users/bitmage/followers","following_url":"https://api.github.com/users/bitmage/following{/other_user}","gists_url":"https://api.github.com/users/bitmage/gists{/gist_id}","starred_url":"https://api.github.com/users/bitmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitmage/subscriptions","organizations_url":"https://api.github.com/users/bitmage/orgs","repos_url":"https://api.github.com/users/bitmage/repos","events_url":"https://api.github.com/users/bitmage/events{/privacy}","received_events_url":"https://api.github.com/users/bitmage/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-16T16:33:08Z","updated_at":"2016-03-30T14:58:49Z","closed_at":"2016-03-28T16:21:27Z","pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/875","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/875","diff_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/875.diff","patch_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/875.patch"},"body":"Some database connectors need to have custom field settings.  E.g. Hbase has column families which could be different on a per field basis.  Reading/writing to Hbase is not possible without knowledge of the column families, so this is an important detail to be captured in schema discovery.\r\n\r\nRight now, there is a namespace reserved for the connector, but it is hard coded to only populate certain properties.  I'd like to extend that to support any additional properties the connector may need.\r\n\r\nA sample discoverModelProperties result for the 'custom' connector might look like this:\r\n\r\n```javascript\r\n[\r\n    {\r\n        owner: 'public',\r\n        columnName: 'name',\r\n        type: 'String',\r\n        required: false,\r\n        custom: {storage: 'quantum'}\r\n    }\r\n]\r\n```\r\n\r\nAnd discoverSchemas:\r\n\r\n```javascript\r\n{\r\n    \"public.person\": {\r\n        \"name\": \"Person\",\r\n        \"options\": {\r\n            \"idInjection\": false,\r\n            \"custom\": {\r\n                \"schema\": \"public\",\r\n                \"table\": \"person\"\r\n            }\r\n        },\r\n        \"properties\": {\r\n            \"name\": {\r\n                \"type\": \"String\",\r\n                \"required\": false,\r\n                \"custom\": {\r\n                    \"columnName\": \"name\",\r\n                    \"storage\": \"quantum\"\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nCode is implemented and tested.  I tried to support this in a way that seems idiomatic to the Loopback design.  Feedback welcome."},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/comments/203475563","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/875#issuecomment-203475563","issue_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/875","id":203475563,"user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T14:58:48Z","updated_at":"2016-03-30T14:58:48Z","body":"@raymondfeng AFAICT, this was not back-ported to the 2.x branch and thus it will be released only in the 3.0-alpha series. Is that intentional?"}}