{"id":13424442,"url":"https://github.com/amberframework/granite","last_synced_at":"2025-04-08T09:06:30.862Z","repository":{"id":36889219,"uuid":"41196214","full_name":"amberframework/granite","owner":"amberframework","description":"ORM Model with Adapters for mysql, pg, sqlite in the Crystal Language.","archived":false,"fork":false,"pushed_at":"2024-12-19T14:25:49.000Z","size":1128,"stargazers_count":297,"open_issues_count":36,"forks_count":88,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-12-29T14:00:58.308Z","etag":null,"topics":["amber","crystal","database","granite","kemal","mysql","orm","orm-model","sql"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/amberframework.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-22T07:28:16.000Z","updated_at":"2024-12-13T13:44:32.000Z","dependencies_parsed_at":"2023-02-10T23:15:39.831Z","dependency_job_id":"2c8ee318-a227-4471-b7e2-a287d6db788f","html_url":"https://github.com/amberframework/granite","commit_stats":{"total_commits":474,"total_committers":67,"mean_commits":7.074626865671642,"dds":0.6371308016877637,"last_synced_commit":"c8b80ee31ea86b130028ecdbd86b18d16c41780d"},"previous_names":["drujensen/amethyst-model"],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amberframework%2Fgranite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amberframework%2Fgranite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amberframework%2Fgranite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amberframework%2Fgranite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amberframework","download_url":"https://codeload.github.com/amberframework/granite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809963,"owners_count":20999816,"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":["amber","crystal","database","granite","kemal","mysql","orm","orm-model","sql"],"created_at":"2024-07-31T00:00:54.392Z","updated_at":"2025-04-08T09:06:30.839Z","avatar_url":"https://github.com/amberframework.png","language":"Crystal","readme":"# Granite\n\n[Amber](https://github.com/amberframework/amber) is a web framework written in\nthe [Crystal](https://github.com/crystal-lang/crystal) language.\n\nThis project is to provide an ORM in Crystal.\n\n# Looking for maintainers\n\nGranite is looking for volunteers to take over maintainership of the repository, reviewing and merging pull requests, stewarding updates to follow along with Crystal language updates, etc. [More information here](https://github.com/amberframework/granite/issues/462)\n\n## Documentation\n\n[Documentation](docs/readme.md)\n\n## Contributing\n\n1. Fork it ( https://github.com/amberframework/granite/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Running tests\nGranite uses Crystal's built in test framework. The tests can be run either within a [dockerized testing environment](#docker-setup) or [locally](#local-setup). \n\nThe test suite depends on access to a PostgreSQL, MySQL, and SQLite database to ensure the adapters work as intended.\n\n### Docker setup\n\nThere is a self-contained testing environment provided via the `docker-compose.yml` file in this repository.\nWe are testing against multiple databases so you have to specify which docker-compose file you would like to use.\n\n- You can find postgres versions at https://hub.docker.com/_/postgres/\n- You can find mysql versions at https://hub.docker.com/_/mysql/\n\nAfter you have docker installed do the following to run tests:\n#### Environment variable setup\n##### Option 1\nExport `.env` with `$ source ./export.sh` or `$ source .env`.\n\n##### Option 2\nModify the `.env` file that docker-compose loads by default. The `.env` file can either be copied to the same directory as the docker-compose.{database_type}.yml files or passed as an option to the docker-compose commands `--env-file ./foo/.env`.\n\n#### First run\n\u003e Replace \"{database_type}\" with \"mysql\" or \"pg\" or \"sqlite\". \n\n```\n$ docker-compose -f docker/docker-compose.{database_type}.yml build spec\n$ docker-compose -f docker/docker-compose.{database_type}.yml run spec\n```\n\n#### Subsequent runs\n\n```\n$ docker-compose -f docker/docker-compose.{database_type}.yml run spec\n```\n\n#### Cleanup\n\nIf you're done testing and you'd like to shut down and clean up the docker dependences run the following:\n\n```\n$ docker-compose -f docker/docker-compose.{database_type}.yml down\n```\n\n#### Run all\n\nTo run the specs for each database adapter use `./spec/run_all_specs.sh`.    This will build and run each adapter, then cleanup after itself.\n\n### Local setup\n\nIf you'd like to test without docker you can do so by following the instructions below:\n\n1. Install dependencies with `$ shards install `\n2. Update .env to use appropriate ENV variables, or create appropriate databases.\n3. Setup databases:\n\n#### PostgreSQL\n\n```sql\nCREATE USER granite WITH PASSWORD 'password';\n\nCREATE DATABASE granite_db;\n\nGRANT ALL PRIVILEGES ON DATABASE granite_db TO granite;\n```\n\n#### MySQL\n\n```sql\nCREATE USER 'granite'@'localhost' IDENTIFIED BY 'password';\n\nCREATE DATABASE granite_db;\n\nGRANT ALL PRIVILEGES ON granite_db.* TO 'granite'@'localhost' WITH GRANT OPTION;\n```\n\n4. Export `.env` with `$ source ./export.sh` or `$ source .env`.\n5. `$ crystal spec`\n","funding_links":[],"categories":["Crystal","ORM/ODM Extensions"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famberframework%2Fgranite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famberframework%2Fgranite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famberframework%2Fgranite/lists"}