{"id":17792408,"url":"https://github.com/sxtanna/korm","last_synced_at":"2025-03-16T17:35:07.543Z","repository":{"id":56185710,"uuid":"124258591","full_name":"Sxtanna/korm","owner":"Sxtanna","description":"Kotlin Object-Relational Mapping","archived":false,"fork":false,"pushed_at":"2022-11-09T17:55:06.000Z","size":2022,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T11:49:57.842Z","etag":null,"topics":["deserialization","java","korm","kotlin","language","orm","serialization"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/Sxtanna.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":"2018-03-07T15:49:42.000Z","updated_at":"2024-05-08T15:04:02.000Z","dependencies_parsed_at":"2022-08-15T14:20:15.140Z","dependency_job_id":null,"html_url":"https://github.com/Sxtanna/korm","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sxtanna%2Fkorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sxtanna%2Fkorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sxtanna%2Fkorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sxtanna%2Fkorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sxtanna","download_url":"https://codeload.github.com/Sxtanna/korm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822295,"owners_count":20353500,"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":["deserialization","java","korm","kotlin","language","orm","serialization"],"created_at":"2024-10-27T10:59:43.800Z","updated_at":"2025-03-16T17:35:07.185Z","avatar_url":"https://github.com/Sxtanna.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/com.sxtanna.korm/Korm.svg?logo=kotlin\u0026style=flat-square)](http://repo1.maven.org/maven2/com/sxtanna/korm/Korm/) [![Travis](https://img.shields.io/travis/com/Sxtanna/KORM.svg?style=flat-square)](https://travis-ci.com/Sxtanna/KORM) [![GitHub](https://img.shields.io/github/license/Sxtanna/KORM.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Sxtanna/korm/\"\u003e\n    \u003cimg src=\"https://i.imgur.com/KNDngsc.png\" alt=\"logo\" width=\"640\" height=\"320\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eKorm\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Kotlin Object Relational Mapping\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/Sxtanna/korm/wiki\"\u003e\u003cstrong\u003eUnimplemented Wiki :) »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/Sxtanna/korm/blob/master/src/test/kotlin/com/sxtanna/korm/Examples.kt\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Sxtanna/korm/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Sxtanna/korm/issues\"\u003eRequest Feature\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Sxtanna/korm/pulls\"\u003eSend a Pull Request\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\n#### This is basically a stripped down Json with slightly different syntax. This readme is going to follow the same format as [TOML's](https://github.com/toml-lang/toml)\n#### At its core, Korm is meant to be purely a transactional format, meaning the document should always be a representation of some object.\n\n\nExample\n-------\n```kotlin\ntitle: \"KORM Example\"\n\nowner: {\n  name: \"Sxtanna\"\n  date: \"03/07/2018\"\n}\n\ndatabase: {\n  server: \"192.168.1.1\"\n  ports: [1234, 5678, 9100]\n  maxConnections: 150\n  enabled: true\n}\n\nservers: {\n  alpha: {\n    ip: \"10.0.0.1\"\n    dc: \"random\"\n  }\n  omega: {\n    ip: \"10.0.0.2\"\n    dc: \"random\"\n  }\n}\n\nclients: {\n  data: [[\"gamma\", \"delta\"], [1, 2]]\n}\n\nhots: [\n  \"alpha\",\n  \"omega\"\n]\n```\n\nGetting Korm\n--------\n### Gradle\n```groovy\ncompile \"com.sxtanna.korm:Korm:+\"\n```\n\n### Maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.sxtanna.korm\u003c/groupId\u003e\n    \u003cartifactId\u003eKorm\u003c/artifactId\u003e\n    \u003cversion\u003eLATEST\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nBasic Usage\n--------\n```kotlin\ndata class User(val name: String, val pass: String)\n\nval korm = Korm()\nval user = User(name = \"Sxtanna\", pass = \"BadPassword\")\n\n// converting from object to korm\nval push = korm.push(user)\nprintln(push) // user: \"Sxtanna\"\n              // pass: \"BadPassword\"\n\n\n// converting from korm to object\nval pull = korm.pull(push).to\u003cUser\u003e()\nprintln(pull) // User(name=Sxtanna, pass=BadPassword)\n\nval same: Boolean = user == pull\nprintln(same) // true\n```\n\nSymbols\n--------\nSymbols come in two formats, basic and complex.\n\n#### Basic\n```kotlin\nbasicKey: 21 // A basic key assigned to the number `21`\n```\n\nIn json:\n```json\n{\n  \"basicKey\": 21\n}\n```\n\n\n#### Complex\n```kotlin\n`char: 'C' hour: 12`: \"Hello\" // A complex key assigned to the word `\"Hello\"`\n```\n\nIn json:\n```json\n{\n  \"{ \"char\": 'C', \"hour\": 12 }\": \"Hello\"\n}\n```\n\nAs you can see, a complex key can be literally anything, they are parsed as their own separate Korm document, which can then be parsed into whatever object they represent.\nSymbols directly represent either field names, or hash keys.\n\n\nSymbol:Assignment\n--------\nThe most basic component of Korm is a symbol and it's assignment, in korm, all symbols must be assigned to something. But data may be free of a symbol. (In this case the entire document would be a single object)\n\n```kotlin\nsymbol: 21\n```\n```kotlin\n[1, 2, 3, 4, 5, 6] // free `List\u003cInt\u003e`\n```\n\n\nList\n--------\nLists should always be a single complex type, or basic types. (Basic or \"primitive\" types are resolved eagerly and can be used heterogeneously)\n\nHomogeneous List\n```kotlin\nnumbers: [1, 2, 3, 4, 5] // List\u003cInt\u003e\n```\n\nHeterogeneous List\n```kotlin\nnumbers: [1, 2, 3.0, 40000] // Can be resolved to `List\u003cNumber\u003e` since all components are of `Number`\n```\n\n```kotlin\ndata class Age(val age: Int)\n\nages: [{ age: 12 }, { age: 14 }, { age: 16 }] // Can be resolved to `List\u003cAge\u003e` (or any collection you want).\n\nages: [21, { age: 23 }] // Will result in either a null result for whichever type isn't supplied, or an error when resolving. Complex lists must always be homogeneous.\n```\n\nHash\n--------\nHash types behave the same way as described above for Lists.\n\nHomogeneous Hash\n```kotlin\npairs: { key0: 0 key1: 1 key2: 2 } // Map\u003cString, Int\u003e\n```\n\nHeterogeneous Hash\n```kotlin\npairs: { key0: 0 key1: 1.0 key2: 2 } // Map\u003cString, Number\u003e\n```\n\n```kotlin\nages: {  // Map\u003cAge, Int\u003e\n  `{ age: 21 }`: 21\n  `{ age: 22 }`: 22\n  `{ age: 23 }`: 23\n}\n```\n\n\nMassive Improvements due to Java Profiling with [![GitHub](https://www.ej-technologies.com/images/product_banners/jprofiler_small.png)](https://www.ej-technologies.com/products/jprofiler/overview.html) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxtanna%2Fkorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsxtanna%2Fkorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxtanna%2Fkorm/lists"}