{"id":31929559,"url":"https://github.com/apskhem/sea-orm-dbml","last_synced_at":"2025-10-14T03:25:07.900Z","repository":{"id":60823818,"uuid":"543680521","full_name":"apskhem/sea-orm-dbml","owner":"apskhem","description":"DBML to SeaORM entity compiler.","archived":false,"fork":false,"pushed_at":"2023-05-07T09:45:56.000Z","size":177,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T17:47:06.559Z","etag":null,"topics":["code-generation","compiler","dbml","orm","rust","sql"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apskhem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-30T16:03:31.000Z","updated_at":"2023-03-22T15:47:31.000Z","dependencies_parsed_at":"2023-02-12T01:01:36.839Z","dependency_job_id":null,"html_url":"https://github.com/apskhem/sea-orm-dbml","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/apskhem/sea-orm-dbml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsea-orm-dbml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsea-orm-dbml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsea-orm-dbml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsea-orm-dbml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apskhem","download_url":"https://codeload.github.com/apskhem/sea-orm-dbml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsea-orm-dbml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017785,"owners_count":26086144,"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-10-14T02:00:06.444Z","response_time":60,"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","compiler","dbml","orm","rust","sql"],"created_at":"2025-10-14T03:25:03.439Z","updated_at":"2025-10-14T03:25:07.896Z","avatar_url":"https://github.com/apskhem.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SeaORM DBML\n\n#### Database Markup Language (DBML) compiler for SeaORM Entity.\n\n[![crate](https://img.shields.io/crates/v/sea-orm-dbml.svg)](https://crates.io/crates/sea-orm-dbml)\n![MSRV](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)\n![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/sea-orm-dbml.svg)\n![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)\n\n## Why DBML?\n\nDBML (Database Markup Language) is an open-source DSL language designed to define and document database schemas and structures. It is designed to be simple, consistent and highly-readable.\n\nRead more: [Official docs](https://www.dbml.org/home/)\n\nThis project aims to make use of DBML as a language for writing SeaORM entity.\n\n## Output\n\nBelow is the example of compiling DBML into SeaORM entity.\n\n```dbml\nTable user {\n  id integer [pk]\n  username varchar\n  role varchar\n}\n```\n\n```rust\n//! Generated by sea-orm-dbml 0.1.0\n\npub mod user {\n  use sea_orm::entity::prelude::*;\n\n  #[derive(Clone, Debug, PartialEq, DeriveEntityModel)]\n  #[sea_orm(table_name = \"user\", schema_name = \"public\")]\n  pub struct Model {\n    #[sea_orm(column_type = \"Integer\", primary_key, auto_increment = false)]\n    pub id: i32,\n    #[sea_orm(column_type = \"String(None)\")]\n    pub username: String,\n    #[sea_orm(column_type = \"String(None)\")]\n    pub role: String,\n  }\n\n  #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]\n  pub enum Relation {}\n\n  impl ActiveModelBehavior for ActiveModel {}\n}\n\n```\n\n## How to use it?\n\n```rust\nuse std::{ffi::OsString, error::Error};\n\nuse sea_orm_dbml::{compiler::config::Config, *};\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n  compile(Config {\n    in_path: OsString::from(\"path/to/file.dbml\"),\n    out_path: OsString::from(\"path/to/out/mod.rs\"),\n    target: compiler::config::Target::Postgres,\n    ..Default::default()\n  })\n}\n\n```\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\nAlways welcome you to participate, contribute and together.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapskhem%2Fsea-orm-dbml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapskhem%2Fsea-orm-dbml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapskhem%2Fsea-orm-dbml/lists"}