summaryrefslogtreecommitdiff
path: root/model/sql
AgeCommit message (Collapse)Author
2024-05-12model: Add per-step ingredientsxengineering
2024-04-06model: CRUD methods only for targeted objectsxengineering
A create, read, update or delete (CRUD) method should only care about the object which provides the receiver and the relations to its child objects. For example the method func (r *Recipe) Create(tx *sql.Tx) error {} should only create the relational data inside the database for the recipe, not for the steps nested into this Recipe struct. This should be covered by the func (s *Step) Create(tx *sql.Tx) error {} method which is then called by `func (r *Recipe) Create()`. This has the advantage that every CRUD method has a constraint scope and is more unified since the Step CRUD methods now have a Step struct as receiver instead of a Recipe receiver.
2024-03-24model: Add recipe stepsxengineering
This provides the infrastructure to create views and HTTP handlers to provide recipe steps.
2024-03-04model: Create test data with Go instead of SQLxengineering
This allows to formulate the test data with an object-based model which is easier than writing it down in a relational model.
2024-02-11model: Switch to very basic database schemaxengineering
This simple model is used to test if it is helpful to implement the four CRUD methods create, read, update and delete all inside the model package. The model package should also provide the datastructures for these operations (well suited for the required views) aswell as tests for them. With this approach it should be possible to easily implement the view and controller package because most of the logic is already inside the model package and is tested.
2023-12-27model: Inject test data into databasexengineering
This is useful for debugging and testing.
2023-12-27model: Add initial SQL migrationxengineering
This provides the basic table structure to the database.