{"action":"created","issue":{"url":"https://api.github.com/repos/amjith/pgcli/issues/127","labels_url":"https://api.github.com/repos/amjith/pgcli/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/amjith/pgcli/issues/127/comments","events_url":"https://api.github.com/repos/amjith/pgcli/issues/127/events","html_url":"https://github.com/amjith/pgcli/pull/127","id":54711239,"number":127,"title":"Make autocomplete schema-aware","user":{"login":"darikg","id":6875882,"avatar_url":"https://avatars.githubusercontent.com/u/6875882?v=3","gravatar_id":"","url":"https://api.github.com/users/darikg","html_url":"https://github.com/darikg","followers_url":"https://api.github.com/users/darikg/followers","following_url":"https://api.github.com/users/darikg/following{/other_user}","gists_url":"https://api.github.com/users/darikg/gists{/gist_id}","starred_url":"https://api.github.com/users/darikg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darikg/subscriptions","organizations_url":"https://api.github.com/users/darikg/orgs","repos_url":"https://api.github.com/users/darikg/repos","events_url":"https://api.github.com/users/darikg/events{/privacy}","received_events_url":"https://api.github.com/users/darikg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-01-18T21:40:48Z","updated_at":"2015-01-24T01:31:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/amjith/pgcli/pulls/127","html_url":"https://github.com/amjith/pgcli/pull/127","diff_url":"https://github.com/amjith/pgcli/pull/127.diff","patch_url":"https://github.com/amjith/pgcli/pull/127.patch"},"body":"This PR would fix #22, and also I think #39 as a side-effect\r\n\r\nIssues:\r\n  * I used pandas DataFrames for working with database metadata -- I found them a lot more flexible than a pure standard lib dict/list based approach. But I'm not sure how you'd feel about adding pandas as a requirement.\r\n  * We don't have any tests for \"DoubleQuoted\" identifiers -- I'm not confident I didn't break that.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/amjith/pgcli/issues/comments/71293899","html_url":"https://github.com/amjith/pgcli/pull/127#issuecomment-71293899","issue_url":"https://api.github.com/repos/amjith/pgcli/issues/127","id":71293899,"user":{"login":"darikg","id":6875882,"avatar_url":"https://avatars.githubusercontent.com/u/6875882?v=3","gravatar_id":"","url":"https://api.github.com/users/darikg","html_url":"https://github.com/darikg","followers_url":"https://api.github.com/users/darikg/followers","following_url":"https://api.github.com/users/darikg/following{/other_user}","gists_url":"https://api.github.com/users/darikg/gists{/gist_id}","starred_url":"https://api.github.com/users/darikg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darikg/subscriptions","organizations_url":"https://api.github.com/users/darikg/orgs","repos_url":"https://api.github.com/users/darikg/repos","events_url":"https://api.github.com/users/darikg/events{/privacy}","received_events_url":"https://api.github.com/users/darikg/received_events","type":"User","site_admin":false},"created_at":"2015-01-24T01:31:31Z","updated_at":"2015-01-24T01:31:31Z","body":">If I understand your correctly, if we make the default schema as a list, then we can stick with the nested-dict as the data-structure for metadata, right?\r\n\r\nYeah, exactly. \r\n\r\n> About the default search_path, do you happen to know how it's set at the user level? If that comes from the database server then can we read that in while starting up?\r\n\r\nI know the query ```SHOW search_path``` returns a string containing a comma separated list of schema names. We could parse that (I guess taking special care for the edge case where a schema is double-quoted and contains a comma) in to a list of schema names. There might be a function in postgresql somewhere that returns a column of schema names instead, which would be nicer.\r\n\r\n> You do have a point about various ways of setting the default, but I can't think of another way to handle it. Even if we decide to go with a different data-structure we'd still need to support a way to complete unqualed references\r\n\r\nWell, it's [handled currently](https://github.com/darikg/pgcli/blob/78288101c20972b4749c04ab49bfba6dfd68717a/pgcli/pgexecute.py#L60) with the pg_catalog.pg_table_is_visible function, which does all the work for us. But then you'd either need to store the is_visible tag for each table (as in the current PR), or keep two redundant data structures (as we discussed upthread). \r\n"}}