{"id":18605810,"url":"https://github.com/coasterfreakde/ork","last_synced_at":"2025-07-29T14:10:18.093Z","repository":{"id":37976084,"uuid":"373128275","full_name":"CoasterFreakDE/ORK","owner":"CoasterFreakDE","description":"Object Relational Mapping for Kotlin","archived":false,"fork":false,"pushed_at":"2023-03-24T11:05:14.000Z","size":588,"stargazers_count":2,"open_issues_count":7,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-11T06:09:09.491Z","etag":null,"topics":["data","database","kotlin","mariadb","mysql","orm","sql","sqlite"],"latest_commit_sha":null,"homepage":"https://devsky.one","language":"HTML","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/CoasterFreakDE.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,"governance":null}},"created_at":"2021-06-02T10:33:49.000Z","updated_at":"2022-11-10T12:26:33.000Z","dependencies_parsed_at":"2023-02-09T02:46:00.128Z","dependency_job_id":"72cffdc1-145c-4804-b8aa-b7c6ac92a6bd","html_url":"https://github.com/CoasterFreakDE/ORK","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/CoasterFreakDE/ORK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoasterFreakDE%2FORK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoasterFreakDE%2FORK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoasterFreakDE%2FORK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoasterFreakDE%2FORK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoasterFreakDE","download_url":"https://codeload.github.com/CoasterFreakDE/ORK/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoasterFreakDE%2FORK/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267701278,"owners_count":24130447,"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-07-29T02:00:12.549Z","response_time":2574,"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":["data","database","kotlin","mariadb","mysql","orm","sql","sqlite"],"created_at":"2024-11-07T02:23:11.545Z","updated_at":"2025-07-29T14:10:18.069Z","avatar_url":"https://github.com/CoasterFreakDE.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg align=\"left\" width=\"100px\" src=\"images/ork.png\"\u003e ORK: Object Relational Mapping for Kotlin\n\n[![Jitpack](https://jitpack.io/v/CoasterFreakDE/ORK.svg)](https://jitpack.io/#CoasterFreakDE/ORK) ![Repo Size](https://img.shields.io/github/repo-size/CoasterFreakDE/ORK) ![Contributors](https://img.shields.io/github/contributors/CoasterFreakDE/ORK) [![Discord](https://img.shields.io/discord/849650088518090813?label=Discord)](https://discord.gg/PEqVSTwy2K) [![CodeFactor](https://www.codefactor.io/repository/github/coasterfreakde/ork/badge)](https://www.codefactor.io/repository/github/coasterfreakde/ork)\n\nORK is a small project aiming to utilizing Kotlin dataclasses to use as ORM System\n\n## Import in your Gradle/Maven Project\n\n### 🐘 - Gradle:\n\n#### Add Jitpack as Maven repo\n```\nrepositories {\n\tmaven { url 'https://jitpack.io' }\n}\n```\n\n#### Add it to your dependencies\n```\ndependencies {\n\tcompile 'com.github.CoasterFreakDE:ork:0.7-SNAPSHOT'\n}\n```\n\n### Maven:\n\n#### Add Jitpack as Maven repo\n```\n\u003crepositories\u003e\n\t\u003crepository\u003e\n\t\t\u003cid\u003ejitpack.io\u003c/id\u003e\n\t\t\u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\t\u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n#### Add it to your dependencies\n```\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.github.CoasterFreakDE\u003c/groupId\u003e\n\t\u003cartifactId\u003eork\u003c/artifactId\u003e\n\t\u003cversion\u003e0.7-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\n\n### Features/Todos:\n\n- [X] Connect to jdbc url\n- [X] Create Tables from DataClass\n- [X] Save (INSERT OR UPDATE) DataClasses directly to your database with `.save()`\n- [X] Delete Data with `.delete()`\n- [ ] Select Data from database\n- [ ] References (Foreign Keys)\n- [ ] Move the PrimaryKey Annotation directly to the field\n\n---\n\n### Connecting to your database\n\nConnecting to your database is easy. Just add your credentials in a \"connect\" block at the start of your app.\n\nTo use sqlite just use `driver { \"sqlite\" }` and `host { \"your.db\" }`\n```kotlin\n\tconnect {\n\t\thost { \"localhost\" }\n\t\tport { 3306 }\n\t\tdriver { \"mariadb\" } // Supported: mysql, mariadb, sqlite\n\t\tdatabase { \"database\" }\n\t\tusername { \"root\" }\n\t\tpassword { \"1234\" }\n\t\tautoReconnect { true }\n\t}\n```\n\n---\n### Creating Tables\n\nTo  create a table there are two steps you need to follow.\n\n#### Create a data class\n\nA Tableclass consists of 3 different parts.\n- Implementing the interface `ITable`\n- At least **one** PrimaryKey\n- FieldNames\n\n```kotlin\n\t@PrimaryKey(\"name\", \"gamegroup\")\n\tdata class MyTable(\n\n\t\t@FieldName(\"name\")\n\t\tval name: String = \"Peter\",\n\n\t\t@FieldName(\"gamegroup\")\n\t\tval gamegroup: String = \"Orks\",\n\n\t\t@FieldName(\"xp\")\n\t\tval xp: Int = 0,\n\n\t) : ITable\n```\n\n#### Create the Table\n\nThis is as simple as putting butter on bread.\nYou can add all your tables into a single statement by separating them with a `,`\n\n```kotlin\n\tcreateTable(MyTable::class.java)\n```\n\n### Saving/Updating/Deleting data\n\nNow comes the fun part. Since you'll be using these features most of the time, they need to be super simple.\n\n```kotlin\n\tval myDataToSave = MyTable(\"Hulk\")\n\tmyDataToSave.save() // Insert or update data to the database\n\tmyDataToSave.delete() // Delete data from the database\n```\n\n### Selecting / Searching for data\n\n![Todo](https://i.imgur.com/OvMZBs9.jpg)\n\n\n### Contributing\n\nFeel free to leave a pull request or ticket for feature requests.\n\n### Code Coverage\n\nTry to cover as much as possible with tests.\nCheck [here](https://CoasterFreakDE.github.io/ORK/code-coverage/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoasterfreakde%2Fork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoasterfreakde%2Fork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoasterfreakde%2Fork/lists"}