{"id":18811375,"url":"https://github.com/chop-dbhi/sql-schema-exporter","last_synced_at":"2026-01-11T06:30:15.471Z","repository":{"id":141917861,"uuid":"100404663","full_name":"chop-dbhi/sql-schema-exporter","owner":"chop-dbhi","description":"Utility to export schema information from a relational database to JSON.","archived":false,"fork":false,"pushed_at":"2017-08-15T18:44:13.000Z","size":3,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-29T23:54:49.783Z","etag":null,"topics":["export","information-schema","schema","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chop-dbhi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-15T18:00:02.000Z","updated_at":"2024-08-20T23:10:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"3fa6a1b8-2439-42a7-bd19-e065afd59bfc","html_url":"https://github.com/chop-dbhi/sql-schema-exporter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chop-dbhi%2Fsql-schema-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chop-dbhi%2Fsql-schema-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chop-dbhi%2Fsql-schema-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chop-dbhi%2Fsql-schema-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chop-dbhi","download_url":"https://codeload.github.com/chop-dbhi/sql-schema-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239748254,"owners_count":19690232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["export","information-schema","schema","sql"],"created_at":"2024-11-07T23:26:04.562Z","updated_at":"2026-01-11T06:30:15.422Z","avatar_url":"https://github.com/chop-dbhi.png","language":"Python","readme":"# SQL Schema Exporter\n\nThis program exports table schema information from a relational database.\n\n## Install\n\n```\npip install -r requirements.txt\n```\n\n## Usage\n\nThe only argument is the URI of the database. The schema (as an array of tables) is emitted to stdout as JSON.\n\n```bash\npython main.py 'postgresql://postgres:secret@127.0.0.1:5432/data' \u003e schema.json\n```\n\nSupported databases:\n\n- PostgreSQL\n- Oracle (requires instantclient libraries to be installed)\n- MySQL\n- SQLite\n\n### Docker\n\nA pre-baked Docker image is available which includes the Oracle driver.\n\n```\ndocker run --rm dbhi/sql-schema-exporter 'postgresql://postgres:secret@127.0.0.1:5432/data' \u003e schema.json\n```\n\nTo build the Docker image locally, the instantclient-* libraries must be in this directly. See the Dockerfile for the file names.\n\n## Data Model\n\n```js\n[\n  {\n    \"schema\": \"\u003cSCHEMA-NAME\u003e\",\n    \"table\": \"\u003cTABLE-NAME\u003e\",\n    \"columns\": [\n      {\n        \"name\": \"\u003cCOLUMN-NAME\u003e\",\n        \"nullable\": \u003cBOOLEAN\u003e,\n        \"type\": \"\u003cDATA-TYPE\u003e\"\n      },\n      // ...\n    ],\n\n    \"primary_key\": [\n      \"\u003cCOLUMN-NAME\u003e\",\n      // ...\n    ],\n\n    \"foreign_keys\": [\n      {\n        \"constrained_columns\": [\n          \"\u003cCOLUMN-NAME\u003e\",\n          // ...\n        ],\n        \"referred_schema\": \"\u003cSCHEMA-NAME\u003e\",\n        \"referred_table\": \"\u003cTABLE-NAME\u003e\",\n        \"referred_columns\": [\n          \"\u003cCOLUMN-NAME\u003e\",\n          // ...\n        ]\n      },\n      //...\n    ],\n\n    \"unique_constraints\": [\n      {\n        \"name\": \"\u003cCONSTRAINT-NAME\u003e\",\n        \"columns\": [\n          \"\u003cCOLUMN-NAME\u003e\",\n          // ...\n        ],\n      },\n      // ...\n    ],\n  },\n  // ...\n]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchop-dbhi%2Fsql-schema-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchop-dbhi%2Fsql-schema-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchop-dbhi%2Fsql-schema-exporter/lists"}