PostgreSQL CREATE TABLE to Kotlin data class
Paste a PostgreSQL CREATE TABLE and get a Kotlin data class: nullable columns become T? = null, NUMERIC maps to BigDecimal so money math stays exact, and timestamps come out as java.time types, the same mapping the JPA entity uses.
Mapped from your real DDL, on the server, discarded after the response.
Example
CREATE TABLE product (
id BIGSERIAL PRIMARY KEY,
sku VARCHAR(40) UNIQUE NOT NULL,
name VARCHAR(200) NOT NULL,
price NUMERIC(12, 2) NOT NULL,
in_stock BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMP NOT NULL DEFAULT now()
);
import java.math.BigDecimal
import java.time.LocalDateTime
data class Product(
val id: Long,
val sku: String,
val name: String,
val price: BigDecimal,
val inStock: Boolean,
val createdAt: LocalDateTime,
)