{"action":"created","issue":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3398","labels_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3398/labels{/name}","comments_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3398/comments","events_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3398/events","html_url":"https://github.com/D-Programming-Language/phobos/pull/3398","id":86793323,"number":3398,"title":"Add etc.c.odbc","user":{"login":"andralex","id":566679,"avatar_url":"https://avatars.githubusercontent.com/u/566679?v=3","gravatar_id":"","url":"https://api.github.com/users/andralex","html_url":"https://github.com/andralex","followers_url":"https://api.github.com/users/andralex/followers","following_url":"https://api.github.com/users/andralex/following{/other_user}","gists_url":"https://api.github.com/users/andralex/gists{/gist_id}","starred_url":"https://api.github.com/users/andralex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andralex/subscriptions","organizations_url":"https://api.github.com/users/andralex/orgs","repos_url":"https://api.github.com/users/andralex/repos","events_url":"https://api.github.com/users/andralex/events{/privacy}","received_events_url":"https://api.github.com/users/andralex/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2015-06-10T01:23:39Z","updated_at":"2015-06-12T02:13:13Z","closed_at":"2015-06-12T01:53:16Z","pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/pulls/3398","html_url":"https://github.com/D-Programming-Language/phobos/pull/3398","diff_url":"https://github.com/D-Programming-Language/phobos/pull/3398.diff","patch_url":"https://github.com/D-Programming-Language/phobos/pull/3398.patch"},"body":"Just a little testing with iODBC - could folks on other OSs give it a shot? There are plenty of simple samples online, I went through this:\r\n\r\n```D\r\nimport etc.c.odbc.sql;\r\nimport etc.c.odbc.sqlext;\r\nimport std.stdio;\r\n\r\nint main() {\r\n  SQLHENV env;\r\n  SQLCHAR driver[256];\r\n  SQLCHAR attr[256];\r\n  SQLSMALLINT driver_ret;\r\n  SQLSMALLINT attr_ret;\r\n  SQLUSMALLINT direction;\r\n  SQLRETURN ret;\r\n\r\n  SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);\r\n  SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, cast(void *) SQL_OV_ODBC3, 0);\r\n\r\n  direction = SQL_FETCH_FIRST;\r\n  while(SQL_SUCCEEDED(ret = SQLDrivers(env, direction,\r\n                       driver.ptr, driver.sizeof, &driver_ret,\r\n                       attr.ptr, attr.sizeof, &attr_ret))) {\r\n    direction = SQL_FETCH_NEXT;\r\n    printf(\"%s - %s\\n\", driver.ptr, attr.ptr);\r\n    if (ret == SQL_SUCCESS_WITH_INFO) printf(\"\\tdata truncation\\n\");\r\n  }\r\n\r\n  return 0;\r\n}\r\n```\r\n\r\nRunning with `rdmd -L-lodbc odbctest.d` should print the installed drivers."},"comment":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/comments/111328845","html_url":"https://github.com/D-Programming-Language/phobos/pull/3398#issuecomment-111328845","issue_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3398","id":111328845,"user":{"login":"andralex","id":566679,"avatar_url":"https://avatars.githubusercontent.com/u/566679?v=3","gravatar_id":"","url":"https://api.github.com/users/andralex","html_url":"https://github.com/andralex","followers_url":"https://api.github.com/users/andralex/followers","following_url":"https://api.github.com/users/andralex/following{/other_user}","gists_url":"https://api.github.com/users/andralex/gists{/gist_id}","starred_url":"https://api.github.com/users/andralex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andralex/subscriptions","organizations_url":"https://api.github.com/users/andralex/orgs","repos_url":"https://api.github.com/users/andralex/repos","events_url":"https://api.github.com/users/andralex/events{/privacy}","received_events_url":"https://api.github.com/users/andralex/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T02:13:13Z","updated_at":"2015-06-12T02:13:13Z","body":"@Kapps yes, I'll follow with a PR with instructions on linking with odbc."}}