No description
Find a file
Waylon S. Walker 29535201ea
Some checks failed
Release / setup (push) Failing after 58s
Release / release (macos-latest) (push) Has been skipped
Release / release (ubuntu-latest) (push) Has been skipped
Release / release (windows-latest) (push) Has been skipped
chore: note repository moved to Forgejo
2025-11-22 19:28:48 -06:00
.github/workflows use easy zip 2023-06-15 08:48:14 -05:00
bin add bin 2023-06-08 21:06:00 -05:00
learn_sql_model wip, might not be good 2025-11-22 19:28:42 -06:00
lights wip, might not be good 2025-11-22 19:28:42 -06:00
migrations wip, might not be good 2025-11-22 19:28:42 -06:00
templates wip, might not be good 2025-11-22 19:28:42 -06:00
tests update tests 2023-06-22 20:24:33 -05:00
.dockerignore wip, might not be good 2025-11-22 19:28:42 -06:00
.gitignore wip, might not be good 2025-11-22 19:28:42 -06:00
.learn-sql-model-copier-answers.yml init 2023-05-19 08:35:16 -05:00
.pyflyby wip 2023-06-20 12:28:25 -05:00
alembic.ini wip 2023-06-06 09:57:21 -05:00
CHANGELOG.md init 2023-05-19 08:35:16 -05:00
client.py wip 2023-06-14 13:43:06 -05:00
client_sender.py wip 2023-06-14 13:43:06 -05:00
creeper.png add creeper image 2023-07-01 13:52:13 -05:00
d3.py wip, might not be good 2025-11-22 19:28:42 -06:00
database.md wip, might not be good 2025-11-22 19:28:42 -06:00
docker-compose.yml wip 2023-06-06 09:57:21 -05:00
Dockerfile wip 2023-06-27 16:19:32 -05:00
dockerfile-dev wip 2023-06-06 09:57:21 -05:00
Dockerfile.dev wip 2023-06-09 16:04:58 -05:00
er_diagram.png wip, might not be good 2025-11-22 19:28:42 -06:00
fly.toml wip 2023-06-14 07:43:55 -05:00
im.png wip, might not be good 2025-11-22 19:28:42 -06:00
index.html wip, might not be good 2025-11-22 19:28:42 -06:00
LICENSE.txt init 2023-05-19 08:35:16 -05:00
load_test.py wip, might not be good 2025-11-22 19:28:42 -06:00
locustfile.py wip, might not be good 2025-11-22 19:28:42 -06:00
map.pkl wip, might not be good 2025-11-22 19:28:42 -06:00
map.png wip, might not be good 2025-11-22 19:28:42 -06:00
markata.toml test em 2023-05-23 08:55:35 -05:00
micro wip, might not be good 2025-11-22 19:28:42 -06:00
notify.py wip, might not be good 2025-11-22 19:28:42 -06:00
pet.png wip, might not be good 2025-11-22 19:28:42 -06:00
player.png wip 2023-06-20 17:09:20 -05:00
pyproject.toml wip, might not be good 2025-11-22 19:28:42 -06:00
README.md chore: note repository moved to Forgejo 2025-11-22 19:28:48 -06:00
rect.py wip, might not be good 2025-11-22 19:28:42 -06:00
tmp.py wip 2023-06-21 16:50:39 -05:00
tmp.sh wip, might not be good 2025-11-22 19:28:42 -06:00
wyatt.py wip, might not be good 2025-11-22 19:28:42 -06:00

Important

This project has been moved to https://git.wayl.one/waylon/learn-sql-model

Learn SQL Model

learning sql model

Development

pip install hatch
hatch shell

Development with Docker

docker compose build
docker compose up -d

To attach to the cli.

docker attach learn-sql-model-cli-1

Start the Server

learn-sql-model api run

Use the cli to manage Heros

learn-sql-model hero create

# show them
learn-sql-model hero get

# show one
learn-sql-model hero get --id 0

Use python to manage Heros

from learn_sql_model.models.hero import Hero
# create a hero
bruce = Hero(name="Batman", secret_name="Bruce Wayne")
bruce.post()
# list all heros
Hero.get()
# get one hero
Hero.get(0)

Use api to create hero

# create a curl POST request to create hero
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"name": "Batman", "secret_name": "Bruce Wayne"}' \
  http://localhost:5000/heros

# list all heros
curl http://localhost:5000/heros
curl -X 'GET' \
  'http://localhost:5000/heros/' \
  -H 'accept: application/json'

# get one hero
curl -X 'GET' \
  'http://localhost:5000/hero/9' \
  -H 'accept: application/json'

Settings Management

config support .env, .env.dev, .env.qa, .env.prod.

ENV=dev
DATABASE_URL=sqlite:///db.sqlite
API_SERVER__PORT=8000
API_SERVER__RELOAD=False
API_SERVER__LOG_LEVEL=debug

Populating the database

learn-sql-model hero populate

Creating new modesl

learn-sql-model model create

License

learn-sql-model is distributed under the terms of the MIT license.