{"id":39935871,"url":"https://github.com/bakenezumi/domala","last_synced_at":"2026-01-18T18:35:02.924Z","repository":{"id":57719722,"uuid":"101825372","full_name":"bakenezumi/domala","owner":"bakenezumi","description":"Domain Oriented Database Mapping Framework for Scala","archived":false,"fork":false,"pushed_at":"2018-07-28T03:08:06.000Z","size":905,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-08-06T16:51:50.389Z","etag":null,"topics":["database","jdbc","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/bakenezumi.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}},"created_at":"2017-08-30T01:51:34.000Z","updated_at":"2018-07-28T03:08:08.000Z","dependencies_parsed_at":"2022-09-13T13:01:57.587Z","dependency_job_id":null,"html_url":"https://github.com/bakenezumi/domala","commit_stats":null,"previous_names":[],"tags_count":8,"template":null,"template_full_name":null,"purl":"pkg:github/bakenezumi/domala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakenezumi%2Fdomala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakenezumi%2Fdomala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakenezumi%2Fdomala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakenezumi%2Fdomala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bakenezumi","download_url":"https://codeload.github.com/bakenezumi/domala/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakenezumi%2Fdomala/sbom","scorecard":{"id":224112,"data":{"date":"2025-08-11","repo":{"name":"github.com/bakenezumi/domala","commit":"c3c73dfa67c18551477aa0d24d2000e439796918"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T03:16:32.222Z","repository_id":57719722,"created_at":"2025-08-17T03:16:32.222Z","updated_at":"2025-08-17T03:16:32.222Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28547298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","jdbc","scala"],"created_at":"2026-01-18T18:35:02.296Z","updated_at":"2026-01-18T18:35:02.915Z","avatar_url":"https://github.com/bakenezumi.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"Domala: Doma for Scala\n======================\n\nDomala is a database access library for Scala. This wraps [Doma2](https://github.com/domaframework/doma).\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.domala/domala_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.domala/domala_2.12)\n[![CircleCI](https://circleci.com/gh/bakenezumi/domala.svg?style=svg)](https://circleci.com/gh/bakenezumi/domala)\n\n- Domala uses [scalameta](http://scalameta.org/paradise/) to generate code and validate sql mappings at **compile time**.\n\n- Select statements are write by yourself. It is automatically mapped to `Option[`*`Entity`*`]`, `Seq[`*`Entity`*`]`, `Stream[`*`Entity`*`]`, `Seq[Map[String, Any]]`, and [more](./notes/specification.md#mapable-types).\n\n- Other statements are automatically generated from Entity. It can also write SQL.\n\n\n### Setup build\n\n#### when use annotation macro\n\nAll functions are available under the setting below.\n\n```scala\nlazy val metaMacroSettings: Seq[Def.Setting[_]] = Seq(\n  addCompilerPlugin(\"org.scalameta\" % \"paradise\" % \"3.0.0-M10\" cross CrossVersion.full),\n  scalacOptions += \"-Xplugin-require:macroparadise\",\n  scalacOptions in (Compile, console) ~= (_ filterNot (_ contains \"paradise\")) // macroparadise plugin doesn't work in repl yet.\n)\n\nlazy val yourProject = project.settings(\n  metaMacroSettings,\n  // required to validate SQL files at compile time\n  compile in Compile := ((compile in Compile) dependsOn (copyResources in Compile)).value,\n  libraryDependencies ++= Seq(\n    \"com.github.domala\" %% \"domala\" % \"0.1.0-beta.9\",\n    \"com.github.domala\" %% \"domala-paradise\" % \"0.1.0-beta.9\" % Provided,\n    \"org.scalameta\" %% \"scalameta\" % \"1.8.0\" % Provided,    \n    // ... your other library dependencies\n  ),\n  // ... your other project settings\n)\n```\n\n#### when not use annotation macro\n\n`@Dao`, `@Entity`, `@Holder` can not be used under the setting below.\n```scala\n\nlazy val yourProject = project.settings(\n  libraryDependencies ++= Seq(\n    \"com.github.domala\" %% \"domala\" % \"0.1.0-beta.9\"\n    // ... your other library dependencies\n  ),\n  // ... your other project settings\n)\n```\n\n\n\n\n### Example\n\n#### Holder\nA value holder\n\n```scala\n@Holder\ncase class Name(value: String)\n```\n\n#### Embeddable\n\nPartial class to embed in entity\n\n```scala\ncase class Address(city: String, street: String)\n```\n\n#### Entity\nClasses whose instances can be stored in a database\n\n`@Entity` can be omitted, but [some functions are restricted]((./notes/specification.md#entity-class)).\n\n```scala\n@Entity\ncase class Person(\n  @Id\n  id: Int,\n  name: Name,\n  age: Option[Int],\n  address: Address,\n  departmentId: Option[Int],\n  @Version\n  version: Option[Int] = None\n)\n```\n\n#### Dao\nTrait of data access object\n\n```scala\n@Dao\ntrait PersonDao {\n\n  @Select(sql = \"\"\"\nselect *\nfrom person\nwhere id = /*id*/0\n  \"\"\")\n  def selectById(id: Int): Option[Person]\n\n  @Insert\n  def insert(person: Person): Result[Person]\n\n  @Update\n  def update(person: Person): Result[Person]\n}\n```\n\nSQL can also be described in an external file.\n\nWhen use external file, the file name must be as follows, and put it on the class path.\n\nMETA-INF/_Dao package name_/_Dao class name_/_Dao method name_.sql\n\n\n\n```scala\npackage example\ntrait PersonDao {\n  @Select\n  def selectByName(name: String): Seq[Person]\n}\n```\nExternal SQL file for this method is as follows.\n\nMETA-INF/example/PersonDao/selectByName.sql\n\n```sql\nselect *\nfrom person where\n/*%if name != null */\n  name like /* @prefix(name) */'%' escape '$'\n/*%end*/\n```\n\n#### Config\nA configuration of a database\n\n```scala\nobject ExampleConfig extends LocalTransactionConfig(\n  dataSource = new LocalTransactionDataSource(\n    \"jdbc:h2:mem:example;DB_CLOSE_DELAY=-1\", \"sa\", null),\n  dialect = new H2Dialect,\n  naming = Naming.SNAKE_LOWER_CASE\n) {\n  Class.forName(\"org.h2.Driver\")\n}\n```\n\n#### Usage\n```scala  \nimplicit val config = ExampleConfig\n\n// Dao implementation is auto generated.\nval dao: PersonDao = PersonDao.impl \n\nval entity = Person(\n  id = 1,\n  name = Name(\"SMITH\"),\n  age = Some(10),\n  address = Address(\"TOKYO\", \"YAESU\"),\n  departmentId = Some(1)\n)\n\n// `Required` is Executes the transaction.\n// If processing in block ends normally it commit.\n// If Exception occurs it rollback.\nRequired {\n  dao.insert(entity)\n  dao.selectById(1).foreach(e =\u003e\n    dao.update(e.copy(age = e.age.map(_ + 1)))\n  )\n}\n```\n\n### Run example\n\n```sh\nsbt\n\u003eexample/run\n```\n\n### In REPL\n\nAnnotation macro doesn't work in repl yet.\nSo, compile separately with `sbt ~console` or use the following SQL interpolations. \n\n```scala\nimport domala._\n// load jdbc driver\nClass.forName(\"org.h2.Driver\")\n\n// A configuration of database\n// domala.jdbc.AdHocConfig works with AutoCommit mode.\nimplicit val config = jdbc.AdHocConfig(\"jdbc:h2:mem:example;DB_CLOSE_DELAY=-1\")\n\n// `script\"...\" ` builds a script query statement\nscript\"create table emp(id int serial primary key, name varchar(20))\".execute()\n\n// `update\"...\" ` builds a `INSERT`, `UPDATE`, `DELETE` query statement\nSeq(\"Scott\", \"Allen\").map { name =\u003e\n  update\"\"\"\n    insert into emp(name) values($name)\n  \"\"\".execute()\n}\n\n// `select\"...\" ` builds a `SELECT` query statement\nselect\"select * from emp order by id\".getMapList\n// =\u003e List(Map(\"ID\" -\u003e 1, \"NAME\" -\u003e \"Scott\"), Map(\"ID\" -\u003e 2, \"NAME\" -\u003e \"Allen\"))\n\nselect\"select id from emp\".getList[Int]\n// =\u003e List(1, 2)\n\ncase class ID[E] (value: Int) extends AnyVal\ncase class Emp(id: ID[Emp], name: String) \nselect\"select * from emp order by id\".getList[Emp]\n// =\u003e List(Emp(ID(1),Scott), Emp(ID(2),Allen))\n\n// EntityManager is assemble and execute SQL automatically from a entity type\njdbc.EntityManager.insert(Emp(ID(3), \"Smith\"))\n\nselect\"select * from emp order by id\".getList[Emp]\n// =\u003e List(Emp(ID(1),Scott), Emp(ID(2),Allen), Emp(ID(3),Smith))\n\n```\n\n### Play integration sample\n\n[domala-play-sample](https://github.com/bakenezumi/domala-play-sample)\n\nLicense\n--------\nApache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakenezumi%2Fdomala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbakenezumi%2Fdomala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakenezumi%2Fdomala/lists"}