{"action":"created","issue":{"url":"https://api.github.com/repos/k0kubun/sqldef/issues/4","repository_url":"https://api.github.com/repos/k0kubun/sqldef","labels_url":"https://api.github.com/repos/k0kubun/sqldef/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/k0kubun/sqldef/issues/4/comments","events_url":"https://api.github.com/repos/k0kubun/sqldef/issues/4/events","html_url":"https://github.com/k0kubun/sqldef/issues/4","id":355139772,"node_id":"MDU6SXNzdWUzNTUxMzk3NzI=","number":4,"title":"sqlparser is MySQL specific.","user":{"login":"stephenpaulger","id":187240,"node_id":"MDQ6VXNlcjE4NzI0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/187240?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenpaulger","html_url":"https://github.com/stephenpaulger","followers_url":"https://api.github.com/users/stephenpaulger/followers","following_url":"https://api.github.com/users/stephenpaulger/following{/other_user}","gists_url":"https://api.github.com/users/stephenpaulger/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenpaulger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenpaulger/subscriptions","organizations_url":"https://api.github.com/users/stephenpaulger/orgs","repos_url":"https://api.github.com/users/stephenpaulger/repos","events_url":"https://api.github.com/users/stephenpaulger/events{/privacy}","received_events_url":"https://api.github.com/users/stephenpaulger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-29T12:36:08Z","updated_at":"2018-08-30T08:56:34Z","closed_at":"2018-08-29T14:06:45Z","author_association":"NONE","body":"Examples for PostgreSQL only work if they use syntax that happens to be the same as MySQL's.\r\n\r\nThis SQL snippet will work in PostgreSQL\r\n\r\n```sql\r\nCREATE TABLE example_postgres_table (\r\n    column_name bool\r\n);\r\n```\r\n\r\nBut attempting to use `psqldef` sadly doesn't work because `bool` isn't a keyword that sqlparser recognises.\r\n\r\n```\r\n% psqldef -U $DBUSER -h $DBHOST -p $DBPORT $DBNAME --dry-run < postgres-table.sql\r\nfound syntax error when parsing DDL \"CREATE TABLE example_postgres_table (    column_name bool)\": syntax error at position 58 near 'bool'\r\n```\r\n\r\nI didn't want to just add the keyword to sqlparser, as that would then allow incorrect SQL to be written for MySQL databases. I had a brief look for existing PostgreSQL parsers in Go but did not find one."},"comment":{"url":"https://api.github.com/repos/k0kubun/sqldef/issues/comments/417243446","html_url":"https://github.com/k0kubun/sqldef/issues/4#issuecomment-417243446","issue_url":"https://api.github.com/repos/k0kubun/sqldef/issues/4","id":417243446,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzI0MzQ0Ng==","user":{"login":"stephenpaulger","id":187240,"node_id":"MDQ6VXNlcjE4NzI0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/187240?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenpaulger","html_url":"https://github.com/stephenpaulger","followers_url":"https://api.github.com/users/stephenpaulger/followers","following_url":"https://api.github.com/users/stephenpaulger/following{/other_user}","gists_url":"https://api.github.com/users/stephenpaulger/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenpaulger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenpaulger/subscriptions","organizations_url":"https://api.github.com/users/stephenpaulger/orgs","repos_url":"https://api.github.com/users/stephenpaulger/repos","events_url":"https://api.github.com/users/stephenpaulger/events{/privacy}","received_events_url":"https://api.github.com/users/stephenpaulger/received_events","type":"User","site_admin":false},"created_at":"2018-08-30T08:56:34Z","updated_at":"2018-08-30T08:56:34Z","author_association":"NONE","body":"Another example of where the two syntax's differ.\r\n\r\n```sql\r\n-- PostgreSQL syntax\r\nCREATE TABLE example_postgres_table (\r\n    \"timestamp\" timestamp\r\n);\r\n\r\n-- MySQL syntax\r\nCREATE TABLE example_mysql_table (\r\n    `timestamp` timestamp\r\n);\r\n```"}}
{"actor":{"display_login":"stephenpaulger"}}