Database Testing with Testcontainers and Kotlin Exposed ORM

This page summarizes the projects mentioned and recommended in the original post on dev.to

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. Exposed

    Kotlin SQL Framework

    object TestDatabase { private val mySQLContainer: MySQLContainer = MySQLContainer("mysql:8.0.26").apply { withDatabaseName("test-db") withUsername("test-user") withPassword("test-password") start() // Start the container } init { val config = HikariConfig().apply { jdbcUrl = mySQLContainer.jdbcUrl username = mySQLContainer.username password = mySQLContainer.password driverClassName = "com.mysql.cj.jdbc.Driver" maximumPoolSize = 10 } val dataSource = HikariDataSource(config) // This doesn't connect to the database but provides a descriptor for future use // In the main app, we would do this on system start up // https://github.com/JetBrains/Exposed/wiki/Database-and-DataSource Database.connect(dataSource) // Create the schema transaction { SchemaUtils.create(Users) } } }

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. Testcontainers

    Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

    In this article, we will explore how to use Testcontainers and Exposed, a lightweight ORM framework for Kotlin, to create a controlled environment for testing MySQL Database operations.

  4. til

    You can find the complete source code for this tutorial on GitHub

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Why people don't like Java?

    5 projects | /r/programming | 27 Feb 2023
  • Writing to db

    5 projects | /r/Kotlin | 20 Feb 2023
  • KTor and non-blocking sql

    2 projects | /r/Kotlin | 18 Feb 2023
  • JOOQ Is Not a Replacement for Hibernate. They Solve Different Problems

    1 project | dev.to | 11 Jan 2025
  • Systems ideas that sound good but almost never work

    1 project | news.ycombinator.com | 31 Dec 2024

Did you know that Kotlin is
the 17th most popular programming language
based on number of references?