{"id":18274256,"url":"https://github.com/scalamolecule/molecule-old","last_synced_at":"2025-04-05T03:30:37.674Z","repository":{"id":57726460,"uuid":"21405797","full_name":"scalamolecule/molecule-old","owner":"scalamolecule","description":"Non-blocking asynchronous domain-customizable database query language for Scala and Scala.js against the Datomic database.","archived":false,"fork":false,"pushed_at":"2023-07-25T05:15:00.000Z","size":9770,"stargazers_count":67,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-20T21:21:17.300Z","etag":null,"topics":["database","datomic","dsl","scala"],"latest_commit_sha":null,"homepage":"http://scalamolecule.org","language":"Scala","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/scalamolecule.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}},"created_at":"2014-07-01T23:57:41.000Z","updated_at":"2024-03-17T22:56:34.000Z","dependencies_parsed_at":"2022-09-26T21:50:48.821Z","dependency_job_id":null,"html_url":"https://github.com/scalamolecule/molecule-old","commit_stats":null,"previous_names":["marcgrue/molecule"],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalamolecule%2Fmolecule-old","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalamolecule%2Fmolecule-old/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalamolecule%2Fmolecule-old/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalamolecule%2Fmolecule-old/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalamolecule","download_url":"https://codeload.github.com/scalamolecule/molecule-old/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284911,"owners_count":20913691,"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":["database","datomic","dsl","scala"],"created_at":"2024-11-05T12:09:00.182Z","updated_at":"2025-04-05T03:30:32.641Z","avatar_url":"https://github.com/scalamolecule.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is an older version of the Molecule Scala library based on macros. It only targets the [Datomic][datomic] database whereas the new Molecule library living in the new [molecule](https://github.com/scalamolecule/molecule) repo targets both Datomic and JDBC-compliant databases.\n\n\n## Old Molecule...\n\nMolecule is a non-blocking asynchronous domain-customizable database query language for Scala and Scala.js against the [Datomic][datomic] database.\n\nTransactions and queries are type-safely built with the terms of your domain and works on both the jvm and js platform.\n\nVisit [ScalaMolecule.org](http://ScalaMolecule.org) to learn more or visit the [Molecule forum](https://groups.google.com/forum/#!forum/molecule-dsl)\n\n[![Gitter](https://badges.gitter.im/scalamolecule/Lobby.svg)](https://gitter.im/scalamolecule/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n\n## Your domain data model == your query language\n\nInstead of squeezing your domain terms in between commands like `SELECT name, age FROM Person` etc, or other query constructs in other database languages, you directly use your domain terms as tokens to fetch data from the database:\n\n```scala\nPerson.name.age.get\n```\n\nThis is possible since a schema is initially defined based on your domain data model:\n\n```scala\ntrait Person {\n  val name = oneString\n  val age  = oneInt\n}\n```\nWhen you compile your project with `sbt compile`, Molecule generates the necessary boilerplate code to allow writing the more intuitive query with type-inferred attributes. Since the types of each attribute `name` and `age` is encoded in the schema definition we'll also get typed data back from our query.\n\n```scala\nval personsWithAge: Future[List[(String, Int)]] = Person.name.age.get\n```\n\n\n## No runtime overhead\nMolecule transform molecules like `Person.name.age.get` to [Datalog](https://docs.datomic.com/on-prem/query.html) queries for Datomic. The returned untyped data from Datomic is then cast by Molecule to the expected Scala type.\n\nAll queries are prepared at compile time by macros. So there is no overhead at runtime when running the queries.\n\n\n## Client transactions and queries\n\nMolecule is fully implemented on both the Scala jvm and Scala.js platforms. This means that you can transact and query data directly from the client side too with the same molecules that you would use on the server side. Molecule transparently handles marshalling data back and forth with one simple [configuration](). \n\nClient molecules relieve you from having to manually define shared apis and make server implementations for shuttling data back and forth between client and server. Like QraphQL clients, just fully type-inferred.\n\n\n## Getting started\n\n- [Introduction](http://www.scalamolecule.org/intro/) to Datomic/Molecule\n- [Setup][setup]: populate a Datomic database with Molecule\n- [Molecule Seattle tutorial](http://www.scalamolecule.org/community/seattle/) examples of using Molecule\n\n\n## Sample projects\n\n1. `git clone https://github.com/scalamolecule/molecule-samples.git`\n2. `cd molecule-samples/molecule-basic`\n3. `sbt compile`\n4. Open in your IDE\n5. Run tests and try adding more attributes...\n\nVarious sample projects show sbt setups for different contexts. You can also read the [Setup][setup] section on the Molecule website. \n\n\n## Basic sbt setup (server side)\n\nAdd the following to your build files:\n\n`project/build.properties`:\n\n```scala\nsbt.version=1.6.1\n```\n\n`project/buildinfo.sbt`:\n\n```scala\naddSbtPlugin(\"org.scalamolecule\" % \"sbt-molecule\" % \"1.0.3\")\n```\n\n`build.sbt`:\n\n```scala\nlazy val yourProject = project.in(file(\"app\"))\n  .enablePlugins(MoleculePlugin)\n  .settings(\n    resolvers ++= Seq(\n      \"datomic\" at \"http://files.datomic.com/maven\",\n      \"clojars\" at \"http://clojars.org/repo\",\n      Resolver.sonatypeRepo(\"releases\")\n    ),\n    libraryDependencies ++= Seq(\n      \"org.scalamolecule\" %% \"molecule\" % \"1.1.0\",\n      \"com.datomic\" % \"datomic-free\" % \"0.9.5697\" // or pro (see README_pro)\n    ),\n    moleculeSchemas := Seq(\"app\") // paths to your schema definition files...\n  )\n```\n\nFor Scala.js setups, please check the [sample rpc projects]() or read the [Setup][setup] section on the Molecule website.\n\nMolecule is available at [maven]((https://repo1.maven.org/maven2/org/scalamolecule/)).\n\n\n#### Author\nMarc Grue\n\n\n#### License\nMolecule is licensed under the [Apache License 2.0](http://en.wikipedia.org/wiki/Apache_license)\n\n[datomic]: http://www.datomic.com\n[setup]: http://www.scalamolecule.org/setup/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalamolecule%2Fmolecule-old","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalamolecule%2Fmolecule-old","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalamolecule%2Fmolecule-old/lists"}