PostgreSQL and Exposed – Kotlin database access



PostgreSQL and Exposed – Kotlin database access

PostgreSQL and Exposed - Kotlin database access

Whether or not we pursue our Event Sourcing experiment from the last episode (https://youtu.be/o5tmT4kwfI4) we know that we want to store our stock data in a database of some sort. So today we investigate using the JetBrains Exposed library (https://github.com/JetBrains/Exposed) to write to and read from PostgreSQL (https://www.postgresql.org/).

Writing tests is a fine way to investigate an API. We can use the tests to invoke functions, and assertions to record what they do, and then work outwards to implement useful and tested code for our application.

This is part 61 of an exploration of where a Test Driven Development implementation of the Gilded Rose stock control system might take us in Kotlin. You can see the whole series as a playlist
https://www.youtube.com/playlist?list=PL1ssMPpyqociJNwykAOB9_KEZVW7BW7m2
and the code on GitHub
https://github.com/dmcg/gilded-rose-tdd

If you like this, you’ll probably like my book Java to Kotlin, A Refactoring Guidebook
(http://java-to-kotlin.dev). It’s about far more than just the syntax differences between the languages – it shows how to upgrade your thinking to a more functional style.

I have some free time between producing videos and working for team Gilded Rose. If you like these videos I’d like to work with you – please get in touch – [email protected]

Comments are closed.