Order Management — Laboratories 1–3

Kotlin 2.3.20 · Exposed 1.0 · PostgreSQL 14.25

Reference project for the Corporate Application Development with Kotlin and SQL course: a HikariCP + Exposed data layer (Lab 1), DSL and DAO mappings with validation and transactional rollback (Lab 2), and a normalised schema with indexes and analytical queries (Lab 3).

Download

Clone

git clone https://host.taild2db2d.ts.net/order-app.git

The served repository is a read-only bare mirror; the owner pushes updates to it.

Run the labs

Each lab runs against your own local PostgreSQL on port 5434, database corporate_dev, user gigaide. The database in this project is not reachable from the internet; only these files are published.

gradlew.bat run        # Lab 1: connect, print PostgreSQL version and SELECT 1
gradlew.bat lab2       # Lab 2: DSL CRUD, joins, DAO, validation, rollback

psql -f lab3/schema.sql
psql -f lab3/seed.sql
psql -f lab3/queries.sql
psql -f lab3/explain.sql

DB_PASSWORD must be set in the environment before running the Gradle tasks; Lab 1's README section explains the one-time setup.

What each lab produced

Lab 1PostgreSQL 14.25 on port 5434, HikariCP pool, version + SELECT 1 output
Lab 2Four tables via Exposed DSL, DAO for customers, repositories, validation and rollback
Lab 3Schema with five indexes, five analytical queries, forced plans, isolation levels

Lab 3's schema.sql drops and recreates the four tables and seed.sql repopulates them, so anything you insert locally can disappear when you re-run the labs.