https://github.com/mduesterhoeft/spring-boot-starter-exposed
A Spring Boot starter for useful autoconfiguration for the Exposed SQL framework
https://github.com/mduesterhoeft/spring-boot-starter-exposed
autoconfiguration database exposed kotlin spring-boot spring-boot-starter sql
Last synced: 7 months ago
JSON representation
A Spring Boot starter for useful autoconfiguration for the Exposed SQL framework
- Host: GitHub
- URL: https://github.com/mduesterhoeft/spring-boot-starter-exposed
- Owner: mduesterhoeft
- Created: 2018-02-20T20:27:22.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-15T10:52:09.000Z (almost 7 years ago)
- Last Synced: 2023-03-03T04:07:39.320Z (about 3 years ago)
- Topics: autoconfiguration, database, exposed, kotlin, spring-boot, spring-boot-starter, sql
- Language: Kotlin
- Homepage:
- Size: 70.3 KB
- Stars: 2
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://jitpack.io/#mduesterhoeft/spring-boot-starter-exposed)
[](https://travis-ci.org/mduesterhoeft/spring-boot-starter-exposed)
[](https://codecov.io/gh/mduesterhoeft/spring-boot-starter-exposed)
# Spring Boot Starter for Exposed
This repository adds a Spring Boot starter for the [Exposed](https://github.com/JetBrains/Exposed) - a Kotlin SQL framework.
## Getting started
The `spring-boot-starter-exposed` is available on jitpack:
```
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compile('com.github.mduesterhoeft:spring-boot-starter-exposed:0.1.7')
}
```
This will bring in `org.jetbrains.exposed:exposed` and `org.springframework.boot:spring-boot-starter-jdbc`.
## Autoconfiguration of Exposed beans
The starter will add a `org.jetbrains.exposed.sql.Database` bean to the application context if a bean of type `javax.sql.DataSource` is present.
If you have the exposed module `org.jetbrains.exposed:spring-transaction` on the classpath and also a `Datasource` bean on the application context, the starter will add a `org.jetbrains.exposed.spring.SpringTransactionManager` bean.
## Schema creation
The starter can be used to initialize the database schema.
To achieve this, a bean of type `com.github.mduesterhoeft.exposed.ExposedTables` is needed on the application context. This bean needs to contain all tables that should be created. The schema generation needs to be enabled like this:
```
spring.exposed.generate-ddl=true
```