FloncDev / exquisite-exoplanets

Our submission for the 2024 Python Discord Code Jam - "Information Overload"
MIT License
0 stars 0 forks source link

Database #5

Closed FloncDev closed 1 month ago

bensgilbert commented 1 month ago

We need to store each user's:

As a bonus we can also store

Since we will be using FastAPI for the API, I vote for using SQLModel which is developed by the same person as the creator of FastAPI and it supports pydantic models. Naturally this means that the database would be SQL

MilaDog commented 1 month ago

SQLModel seems good. Haven't tried it out (mainly used the base shipped Pydantic, but can learn it).

From some brainstorming: db_brainstorm

i-am-unknown-81514525 commented 1 month ago

I was thinking should we just use normal file storage for the user script?

- scripts (dir)
 - user_id1 (dir)
  - {script_id}.script (file)

and the database only store the reference to the active script by script_id

i-am-unknown-81514525 commented 1 month ago

This could further extend to the storing format for the field

{
    "machine_type": [] // list of script_id
}