PostgreSQL and Exposed - Kotlin database access

preview_player
Показать описание

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

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
and the code on GitHub

If you like this, you’ll probably like my book Java to Kotlin, A Refactoring Guidebook

Рекомендации по теме
Комментарии
Автор

16:40 Any particular reason to use "error" method with elvis operator over "checkNotNull / check"?

JentaroYusong
Автор

3:48 You can use Alt + Enter in IntelliJ (inside the test sources) to generate a test method. I think multiple runners / frameworks are supported, but I can't remember which ones right now, besides JUnit 5 which I use all the time.
Also, you can press Ctrl + Shift + T in a non test file to generate a test file for the code you're in. This combination also allows to switch between tests and implementation.

JentaroYusong
Автор

If you're using exposed sql, why did you choose manual implementations rather than using their built-in DAO implementation?

codingjq
Автор

18:40 TBH, that's not really the fault of IntelliJ: You have turned on "Add unambiguous imports on the fly" in the settings under "Editor→General→Auto Import", that's why it imports the only Items class it finds.
You can either turn that feature off again (it is off by default I think?) or, in the same dialog, exclude packages like "com.sun.*" from auto-importing.

henninghoefer
Автор

can you please help me connect a SQL database created with xampp to connect with Android studio app in kotlin?

senzokhumalo
Автор

I'm a few minutes into the vid... I was going to use Hibernate for no other reason that I've used it before. Exposed looks more palatable and I'm writing in Kotin. Is there any reason I should choose Hibernate over Kotlin?

KeithWhittingham
Автор

Thanks for video. Would be good to see something about creating/updating database schema for development, the way we can load development/testing fixtures to the database and environment based configuration for exposed

alexanderchip
Автор

im still waiting for the kotlin native compatibility for 2 yrs now...seems weird they are pushing native and multiplatform alot and neglecting this library since its an official one

sharkpyro
welcome to shbcf.ru