{"id":31929548,"url":"https://github.com/apskhem/sqlx-dbml","last_synced_at":"2025-10-14T03:25:05.721Z","repository":{"id":182477863,"uuid":"667865032","full_name":"apskhem/sqlx-dbml","owner":"apskhem","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-23T09:37:56.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-20T08:01:31.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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,"governance":null}},"created_at":"2023-07-18T13:26:35.000Z","updated_at":"2023-07-18T20:05:26.000Z","dependencies_parsed_at":"2023-07-20T07:03:17.341Z","dependency_job_id":null,"html_url":"https://github.com/apskhem/sqlx-dbml","commit_stats":null,"previous_names":["apskhem/sqlx-dbml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apskhem/sqlx-dbml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsqlx-dbml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsqlx-dbml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsqlx-dbml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsqlx-dbml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apskhem","download_url":"https://codeload.github.com/apskhem/sqlx-dbml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apskhem%2Fsqlx-dbml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017786,"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":[],"created_at":"2025-10-14T03:24:59.824Z","updated_at":"2025-10-14T03:25:05.710Z","avatar_url":"https://github.com/apskhem.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQLx DBML\n\n#### Database Markup Language (DBML) Code Generation for SQLx Structs.\n\n[![crate](https://img.shields.io/crates/v/sqlx-dbml.svg)](https://crates.io/crates/sqlx-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/sqlx-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 generating SQLx structs.\n\n## Output\n\nBelow is the example of generating DBML into SQLx structs.\n\n```dbml\nTable user {\n  id integer [pk]\n  username varchar\n  role varchar\n}\n```\n\n```rust\n//! Generated by sqlx-dbml 0.1.0\n\npub mod user {\n  use sqlx::*;\n\n  #[derive(FromRow)]\n  pub struct Model {\n    pub id: i32,\n    pub username: String,\n    pub role: String,\n  }\n}\n\n```\n\n## How to use it?\n\n```rust\nuse std::{ffi::OsString, error::Error};\n\nuse sqlx_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%2Fsqlx-dbml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapskhem%2Fsqlx-dbml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapskhem%2Fsqlx-dbml/lists"}