Skip to content
0:00 / 0:00

#exposed#postgresql#kotlin

PostgreSQL and Exposed - Kotlin database access

Pairing with Duncan

4.5K subscribers • 15 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Duncan
  • Linked in the descriptionJetBrains/Exposeddmcg/gilded-rose-tdd
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

8.6K views3 years ago1 recommendation

Programming languagesDatabases and dataKotlinPostgresSQL

Duncan explores using the JetBrains Exposed library to read and write data to a PostgreSQL database in Kotlin.

Whether or not we pursue our Event Sourcing experiment from the last episode (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 (github.com/JetBrains/Exposed) to write to and read from PostgreSQL (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. After evaluating both, in the end I choose jOOQ over Exposed for our database access. See jOOQ and PostgreSQL - youtu.be/0WcNM7UCtmQ jOOQ vs Exposed - youtu.be/6Ji9yKnZ3D8 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 youtube.com/playlist?list=PL1ssMPpyqociJNwykAOB9_KEZVW7BW7m2 and the code on GitHub github.com/dmcg/gilded-rose-tdd If you like this, you’ll probably like my book Java to Kotlin, A Refactoring Guidebook (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 - duncan@oneeyedmen.com

Why it's here

1 person recommends this

What people say. Linked as a hands-on evaluation of JetBrains Exposed for database access in Kotlin.

u/dmcgin r/Kotlin • Recommends

PostgreSQL and Exposed - Kotlin database access

u/dmcgin r/Kotlin • Mentions

On “Introducing jOOQ with Lukas Eder”

From the description: Team Gilded Rose in honoured this week to welcome Lukas Eder to introduce jOOQ - the Java Object Oriented Query library (https://www.jooq.org/). We looked at JetBrains Exposed for talking to PostgreSQL in a previous episode ([video jOOQ is less Kotlin-specific but much more mature, so we're lucky tohave the opportunity to learn from its creator. This is part 68 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[video and the code on GitHubhttps://github.com/dmcg/gilded-rose-tdd This is Part 1 of 2 with Lukas. Other database-specific episod…

u/dmcgin r/Kotlin • Mentions

On “jOOQ vs Exposed”

This is part two of my interview with Lukas Eder about jOOQ - the Java Object Oriented Query library (https://www.jooq.org/), best watched after part one ([video this part we take the code we had written in tests and move it into an implementation of the repository pattern, checking that jOOQ version passes the tests we had previously written for Exposed (([video At the end of the episode Lukas has some very interesting insights into the differences between Exposed and jOOQ, and the features that make jOOQ unique in database mapping on the JVM. This is part 69 of an exploration of where a Test Driven Development implementation of the Gilded Rose stock control system might take us in Ko…

u/dmcgin r/Kotlin • Mentions

On “Using PostgreSQL as an Append-only Datastore with Kotlin and Exposed”

From the description: In our last episode ([video we worked out how to save stock items in PostgreSQL (https://www.postgresql.org/) using the JetBrains Exposed library (https://github.com/JetBrains/Exposed). This time we refactor our existing file-based storage, extracting an interface that we can implement with files, in-memory, or with Exposed. For the database version, instead of replacing items in a table whenthey change, we choose to implement an append-only datastore. This keeps all the old versions of every row, using a query to select the latest versions when we want to see the current state. This has the advantage that we can rebuild the state of our system if things go wrong, a…