{"id":13550400,"url":"https://github.com/schultek/stormberry","last_synced_at":"2025-10-25T14:07:41.463Z","repository":{"id":48780550,"uuid":"362224838","full_name":"schultek/stormberry","owner":"schultek","description":"Access your postgres database effortlessly from dart code.","archived":false,"fork":false,"pushed_at":"2025-01-17T11:49:45.000Z","size":441,"stargazers_count":74,"open_issues_count":17,"forks_count":19,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T22:05:02.227Z","etag":null,"topics":["dart","hacktoberfest","orm","postgres","sql"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/stormberry","language":"Dart","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/schultek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"schultek"}},"created_at":"2021-04-27T19:15:31.000Z","updated_at":"2025-03-13T20:51:18.000Z","dependencies_parsed_at":"2024-01-12T18:13:40.257Z","dependency_job_id":"cec6d908-f9f5-41d9-b271-b662784ad03c","html_url":"https://github.com/schultek/stormberry","commit_stats":{"total_commits":148,"total_committers":7,"mean_commits":"21.142857142857142","dds":"0.17567567567567566","last_synced_commit":"e78868e2f1228f02d1ae36e27b5f71166e180498"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultek%2Fstormberry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultek%2Fstormberry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultek%2Fstormberry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultek%2Fstormberry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schultek","download_url":"https://codeload.github.com/schultek/stormberry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411234,"owners_count":20934653,"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":["dart","hacktoberfest","orm","postgres","sql"],"created_at":"2024-08-01T12:01:32.608Z","updated_at":"2025-10-25T14:07:41.391Z","avatar_url":"https://github.com/schultek.png","language":"Dart","funding_links":["https://github.com/sponsors/schultek"],"categories":["Dart"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eStormberry\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pub.dev/packages/stormberry\"\u003e\n    \u003cimg src=\"https://img.shields.io/pub/v/stormberry?label=pub.dev\u0026labelColor=333940\u0026logo=dart\u0026color=00589B\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schultek/stormberry/actions/workflows/test.yaml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/schultek/stormberry/test.yaml?branch=main\u0026label=tests\u0026labelColor=333940\u0026logo=github\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://app.codecov.io/gh/schultek/stormberry\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/schultek/stormberry?logo=codecov\u0026logoColor=fff\u0026labelColor=333940\"\u003e\n  \u003c/a\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://twitter.com/schultek_dev\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/follow-%40schultek__dev-1DA1F2?style=flat\u0026label=follow\u0026color=1DA1F2\u0026labelColor=333940\u0026logo=twitter\u0026logoColor=fff\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schultek/stormberry\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/schultek/stormberry?style=flat\u0026label=stars\u0026labelColor=333940\u0026color=8957e5\u0026logo=github\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nA \u003cb\u003estrongly-typed postgres ORM\u003c/b\u003e to provide easy bindings between your dart classes and postgres database. \nIt supports all kinds of \u003cb\u003erelations without any complex configuration\u003c/b\u003e.\n\u003c/p\u003e\n\n---\n\n# Quick Start\n\nTo get started, add `stormberry` as a dependency and `build_runner` as a dev dependency:\n\n```shell\ndart pub add stormberry\ndart pub add build_runner --dev\n```\n\nIn your code, specify an abstract class that should act as a table like this:\n\n```dart\n// This file is \"model.dart\"\nimport 'package:stormberry/stormberry.dart';\n\n// Will be generated by stormberry\npart 'model.schema.dart';\n\n@Model()\nabstract class User {\n  @PrimaryKey()\n  String get id;\n\n  String get name;\n}\n```\n\nIn order to generate the database code, run the following command:\n\n```shell script\ndart run build_runner build\n```\n\n***Tip**: You'll need to re-run code generation each time you are making changes to your models.\nDuring development, you can use `watch` to automatically watch your changes: `dart pub run build_runner watch`.*\n\nThis will generate a `.schema.dart` file that you should add as a `part` to the original model file.\n\n---\n\nBefore running your application, you have to migrate your database. To do this run:\n\n```shell\ndart run stormberry migrate\n```\n\nThis will ask you for the connection details of your postgres database and then migrate\nthe database schema by adding the `users` table.\n\n---\n\nTo access your database from your application, create a `Database` instance and use the `users`\nrepository like this:\n\n```dart\nvoid main() async {\n  \n  var db = Database(\n    // connection parameters go here\n  );\n  \n  // adds a user to the 'users' table\n  await db.users.insertOne(UserInsertRequest(id: 'abc', name: 'Alex'));\n  \n  // finds a user by its 'id'\n  var user = await db.users.queryUser('abc');\n  \n  assert(user.name == 'Alex');\n}\n```\n\n## Full Documentation\n\nSee the full documentation [here](https://pub.dev/documentation/stormberry/latest/topics/Introduction-topic.html)\nor jump directly to the topic you are looking for:\n\n- [**Models**](https://pub.dev/documentation/stormberry/latest/topics/Models-topic.html)\n- [**Views**](https://pub.dev/documentation/stormberry/latest/topics/Views-topic.html)\n- [**Database**](https://pub.dev/documentation/stormberry/latest/topics/Database-topic.html)\n- [**Repositories**](https://pub.dev/documentation/stormberry/latest/topics/Repositories-topic.html)\n- [**Queries \u0026 Actions**](https://pub.dev/documentation/stormberry/latest/topics/Queries%20\u0026%20Actions-topic.html)\n- [**Migration**](https://pub.dev/documentation/stormberry/latest/topics/Migration-topic.html)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultek%2Fstormberry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschultek%2Fstormberry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultek%2Fstormberry/lists"}