{"id":19120873,"url":"https://github.com/waylonwalker/learn-sql-model","last_synced_at":"2025-07-18T15:35:33.381Z","repository":{"id":167433964,"uuid":"642848175","full_name":"WaylonWalker/learn-sql-model","owner":"WaylonWalker","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-02T14:32:39.000Z","size":411,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T12:45:26.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/WaylonWalker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-05-19T13:34:45.000Z","updated_at":"2023-06-22T14:16:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f58d2c7-f5fe-4296-9e91-2b45d15c2d91","html_url":"https://github.com/WaylonWalker/learn-sql-model","commit_stats":null,"previous_names":["waylonwalker/learn-sql-model"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/WaylonWalker/learn-sql-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaylonWalker%2Flearn-sql-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaylonWalker%2Flearn-sql-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaylonWalker%2Flearn-sql-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaylonWalker%2Flearn-sql-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WaylonWalker","download_url":"https://codeload.github.com/WaylonWalker/learn-sql-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaylonWalker%2Flearn-sql-model/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265786734,"owners_count":23828323,"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":[],"created_at":"2024-11-09T05:15:17.058Z","updated_at":"2025-07-18T15:35:33.346Z","avatar_url":"https://github.com/WaylonWalker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learn SQL Model\n\nlearning sql model\n\n## Development\n\n```console\npip install hatch\nhatch shell\n```\n\n## Development with Docker\n\n```console\ndocker compose build\ndocker compose up -d\n```\n\nTo attach to the cli.\n\n```console\ndocker attach learn-sql-model-cli-1\n```\n\n## Start the Server\n\n```console\nlearn-sql-model api run\n```\n\n## Use the cli to manage Heros\n\n```console\nlearn-sql-model hero create\n\n# show them\nlearn-sql-model hero get\n\n# show one\nlearn-sql-model hero get --id 0\n```\n\n## Use python to manage Heros\n\n```python\nfrom learn_sql_model.models.hero import Hero\n# create a hero\nbruce = Hero(name=\"Batman\", secret_name=\"Bruce Wayne\")\nbruce.post()\n# list all heros\nHero.get()\n# get one hero\nHero.get(0)\n```\n\n## Use api to create hero\n\n```console\n# create a curl POST request to create hero\ncurl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Batman\", \"secret_name\": \"Bruce Wayne\"}' \\\n  http://localhost:5000/heros\n\n# list all heros\ncurl http://localhost:5000/heros\ncurl -X 'GET' \\\n  'http://localhost:5000/heros/' \\\n  -H 'accept: application/json'\n\n# get one hero\ncurl -X 'GET' \\\n  'http://localhost:5000/hero/9' \\\n  -H 'accept: application/json'\n```\n\n## Settings Management\n\nconfig support `.env`, `.env.dev`, `.env.qa`, `.env.prod`.\n\n```.env\nENV=dev\nDATABASE_URL=sqlite:///db.sqlite\nAPI_SERVER__PORT=8000\nAPI_SERVER__RELOAD=False\nAPI_SERVER__LOG_LEVEL=debug\n```\n\n## Populating the database\n\n```bash\nlearn-sql-model hero populate\n```\n\n## Creating new modesl\n\n```bash\nlearn-sql-model model create\n```\n\n## License\n\n`learn-sql-model` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaylonwalker%2Flearn-sql-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaylonwalker%2Flearn-sql-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaylonwalker%2Flearn-sql-model/lists"}