{"action":"created","issue":{"url":"https://api.github.com/repos/oelmekki/pgrebase/issues/2","repository_url":"https://api.github.com/repos/oelmekki/pgrebase","labels_url":"https://api.github.com/repos/oelmekki/pgrebase/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/oelmekki/pgrebase/issues/2/comments","events_url":"https://api.github.com/repos/oelmekki/pgrebase/issues/2/events","html_url":"https://github.com/oelmekki/pgrebase/issues/2","id":190420630,"number":2,"title":"Introduce Schema as a level in directory structure","user":{"login":"ruslantalpa","id":5537246,"avatar_url":"https://avatars.githubusercontent.com/u/5537246?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslantalpa","html_url":"https://github.com/ruslantalpa","followers_url":"https://api.github.com/users/ruslantalpa/followers","following_url":"https://api.github.com/users/ruslantalpa/following{/other_user}","gists_url":"https://api.github.com/users/ruslantalpa/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslantalpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslantalpa/subscriptions","organizations_url":"https://api.github.com/users/ruslantalpa/orgs","repos_url":"https://api.github.com/users/ruslantalpa/repos","events_url":"https://api.github.com/users/ruslantalpa/events{/privacy}","received_events_url":"https://api.github.com/users/ruslantalpa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-18T21:00:35Z","updated_at":"2016-11-18T21:51:52Z","closed_at":null,"body":"Maybe this is already supported but it would be nice if this tool could understand code living in different schemas (used for namespacing)\r\n\r\nIt will make a really nice dev tool for working with things like PostgREST.\r\nThank you for the tool."},"comment":{"url":"https://api.github.com/repos/oelmekki/pgrebase/issues/comments/261651433","html_url":"https://github.com/oelmekki/pgrebase/issues/2#issuecomment-261651433","issue_url":"https://api.github.com/repos/oelmekki/pgrebase/issues/2","id":261651433,"user":{"login":"oelmekki","id":54562,"avatar_url":"https://avatars.githubusercontent.com/u/54562?v=3","gravatar_id":"","url":"https://api.github.com/users/oelmekki","html_url":"https://github.com/oelmekki","followers_url":"https://api.github.com/users/oelmekki/followers","following_url":"https://api.github.com/users/oelmekki/following{/other_user}","gists_url":"https://api.github.com/users/oelmekki/gists{/gist_id}","starred_url":"https://api.github.com/users/oelmekki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oelmekki/subscriptions","organizations_url":"https://api.github.com/users/oelmekki/orgs","repos_url":"https://api.github.com/users/oelmekki/repos","events_url":"https://api.github.com/users/oelmekki/events{/privacy}","received_events_url":"https://api.github.com/users/oelmekki/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T21:51:52Z","updated_at":"2016-11-18T21:51:52Z","body":"Oh, I see.\r\n\r\nWell first, the directories under the target directory are walked, so one thing you can already do is:\r\n\r\n```\r\n$ tree ./sql/\r\n./sql/\r\n├── functions\r\n│   ├── other\r\n│   │   └── assign_user_to_team.sql\r\n│   └── public\r\n│       └── assign_user_to_team.sql\r\n├── triggers\r\n│   ├── other\r\n│   │   └── user_updated_at.sql\r\n│   └── public\r\n│       └── user_updated_at.sql\r\n└── views\r\n    ├── other\r\n    │   └── user_json.sql\r\n    └── public\r\n        └── user_json.sql\r\n```\r\n\r\nThis works out of the box, but may not be very easy to look at your code if you think in terms of sql modules.\r\n\r\nAn other option, provided you have a not insanely large amount of modules and that code from one module does not depend on code from an other, would be to launch several instances:\r\n\r\n```\r\n$ tree ./sql/\r\n./sql/\r\n├── other\r\n│   ├── functions\r\n│   ├── triggers\r\n│   └── views\r\n└── public\r\n    ├── functions\r\n    ├── triggers\r\n    └── views\r\n\r\n$ pgrebase ./sql/public/ &\r\n$ pgrebase ./sql/other/\r\n```\r\n\r\n(obviously better in several different shells, to have output)\r\n\r\nI'm currently considering a more solid dependency resolver, for the `require` statements, the goal being to do real filesystem resolution rather than just the current filename matching (the reason why there are those functions/, triggers/, types/ and views/ directories). When it will be implemented, this should allow to be more permissive regarding the FS organization. "}}
{"actor":{"display_login":"oelmekki"}}