Database

This section will demonstrate how to connect to popular databases from Zig.

Data model used are as follows:

  1. Create two tables: cat_colors, cats, cats has a reference in cat_colors.
  2. Create prepare statement for each table, and insert data.
  3. Execute a join query to get cat_name and color_name at the same time.

cat_colors

idname
1Blue
2Black

cats

idnamecolor_id
1Tigger1
2Sammy1
3Oreo2
4Biscuit2
Last change: 2024-03-09, commit: 7ff947d