{"id":21915971,"url":"https://github.com/artarts36/db-exporter","last_synced_at":"2026-04-09T20:03:24.342Z","repository":{"id":226299234,"uuid":"768309092","full_name":"ArtARTs36/db-exporter","owner":"ArtARTs36","description":"Console application for export db schema and data to formats","archived":false,"fork":false,"pushed_at":"2025-10-26T10:52:00.000Z","size":1073,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T12:28:04.331Z","etag":null,"topics":["code-generation","code-generator","csv","db","dbml","docs","documentation","markdown","mysql","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtARTs36.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-06T21:09:38.000Z","updated_at":"2025-10-26T10:52:04.000Z","dependencies_parsed_at":"2024-03-24T00:27:16.484Z","dependency_job_id":"40e3e866-9678-4f69-88fa-929d0ded17a5","html_url":"https://github.com/ArtARTs36/db-exporter","commit_stats":null,"previous_names":["artarts36/db-exporter"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/ArtARTs36/db-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fdb-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fdb-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fdb-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fdb-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtARTs36","download_url":"https://codeload.github.com/ArtARTs36/db-exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fdb-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282486107,"owners_count":26677118,"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","status":"online","status_checked_at":"2025-11-03T02:00:05.676Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["code-generation","code-generator","csv","db","dbml","docs","documentation","markdown","mysql","postgresql"],"created_at":"2024-11-28T19:15:21.211Z","updated_at":"2026-04-09T20:03:24.331Z","avatar_url":"https://github.com/ArtARTs36.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# db-exporter\n\n![Docker Image Version](https://img.shields.io/docker/v/artarts36/db-exporter?style=for-the-badge\u0026logo=docker\u0026label=Image%20Version\u0026link=https%3A%2F%2Fhub.docker.com%2Fr%2Fartarts36%2Fdb-exporter)\n![Docker Image Size](https://img.shields.io/docker/image-size/artarts36/db-exporter?style=for-the-badge\u0026logo=docker\u0026label=Image%20Size\u0026link=https%3A%2F%2Fhub.docker.com%2Fr%2Fartarts36%2Fdb-exporter)\n\n**db-exporter** - application for export db schema and data to formats\n\n[🚀 Use with GitHub Actions](./docs/usage_examples.md#use-with-github-actions)\n\n[🚀 Use with Gitlab CI](./docs/usage_examples.md#use-with-gitlab-ci)\n\n**Exporters**\n\n| Exporter                 | Description                                                                     | Usage example                                                                                                 |\n|--------------------------|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|\n| `grpc-crud`              | Exports CRUD in .proto from database schema                                     |                                                                                                               |\n| `ddl`                    | Exports DDL from database schema                                                |                                                                                                               |\n| `csv`                    | Exports data from tables                                                        |                                                                                                               |\n| `md`                     | Exports database schema to Markdown                                             | [Schema ➡️ Markdown](./docs/usage_examples.md#export-schema-from-postgresql-to-markdown)                      |\n| `diagram`                | Exports database schema as image of Class Diagram                               |                                                                                                               |\n| `go-entities`            | Go structures with db tags                                                      | [Schema ➡️ Go entities, repositories](./docs/usage_examples.md#export-schema-to-go-entities-and-repositories) |\n| `go-entity-repository`   | Go structures with db tags and repositories                                     |                                                                                                               |\n| `goose`                  | Goose migrations                                                                |                                                                                                               |\n| `goose-fixtures`         | Exports data from tables as inserts to Goose migrations                         |                                                                                                               |\n| `go-sql-migrate`         | Migrations for [sql-migrate](https://github.com/rubenv/sql-migrate)             |                                                                                                               |\n| `laravel-migrations-raw` | Raw SQL Laravel migrations                                                      |                                                                                                               |\n| `laravel-models`         | Exports database schema as Laravel models                                       |                                                                                                               |\n| `json-schema`            | Exports database schema to [JSON Schema](https://json-schema.org)               |                                                                                                               |\n| `graphql`                | Exports database schema to [GraphQL](https://graphql.org/learn/schema) types    |                                                                                                               |\n| `dbml`                   | Exports database schema to DBML (table, ref, enum)                              |                                                                                                               |\n| `custom`                 | Exports DB schema by your template with [Twig](https://twig.symfony.com) syntax | [Generating .txt files from a template built into the configuration](./docs/usage_custom.md)                  |\n| `mermaid`                | Exports DB schema to Mermaid ER Diagram                                         |                                                                                                               |\n\nSupported database schemas:\n- ![](./docs/icons/postgres.png) PostgreSQL\n- ![](./docs/icons/dbml.png) DBML: only export db schema, without fixtures and import\n- ![](./docs/icons/mysql.png) MySQL\n\nusage:\n```text\nUsage\n  db-exporter[--config] [--tasks]\n\nOptions\n  config                        Path to config file (yaml), default: ./.db-exporter.yaml\n  tasks                         task names of config file\n\nUsage examples\n  db-exporter --config db.yaml  Run db-exporter with custom config path\n```\n\n\u003ccenter\u003e\u003cimg src=\"./docs/principle.png\"\u003e\u003c/center\u003e\n\n## Configuration\n\nThe exporter operates on tasks that have activities.\n\n![](./docs/configuration.drawio.png)\n\nFor example, to describe the export of a database schema to a GraphQL, the following configuration is required.\n\n```yaml\ndatabases:\n  default:\n    driver: postgres\n    dsn: ${PG_DSN}\n\ntasks:\n  gen_graphql:\n    activities:\n      - format: graphql\n        out:\n          dir: ./out/graphql\n```\n\nConfig file declared in [JSON Schema](db-exporter-json-schema.json)\n\n### Environment variables\nYou can inject environment variables to config:\n\n- **DSN** to database in `databases`:\n    ```yaml\n    databases:\n      default:\n        driver: postgres\n        dsn: $PG_DSN\n    ```\n- **Commit Author** in `tasks`:\n    ```yaml\n  tasks:\n    gen_docs:\n      commit: \n        author: ${COMMIT_AUTHOR}\n      activities:\n        ...\n    ```\n- **Tables List** in `activities`\n    ```yaml\n  tasks:\n    gen_csv:\n      activities:\n        - format: csv\n          tables:\n            list: ${MY_TABLES}\n    ```\n\n## Articles\n\nНа русском:\n- [Генерируем CRUD для gRPC по схеме БД следуя Google AIP](https://tproger.ru/articles/generiruem-crud-dlya-grpc-po-sheme-bd)\n- [Генерируем документацию к БД и не мучаем разработчиков](https://dzen.ru/a/aOlhYHhHszJpeGgW)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartarts36%2Fdb-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartarts36%2Fdb-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartarts36%2Fdb-exporter/lists"}