For example if a column has a type different from standard(string, number, ...) we must be able to add that specific info.
CREATE TYPE PRODUCT AS ENUM ('phone', 'laptop', 'mouse');
CREATE TABLE products (
id BIGSERIAL NOT NULL PRIMARY KEY,
title VARCHAR(20) NOT NULL,
type PRODUCT NOT NULL
);
For example solution could be:
<dataset>
<products id="1" title="Pixel">
<column name="type" type="PRODUCT" value="laptop" />
</products>
</dataset>
Other syntax could be
<dataset>
<products id="1" title="Pixel" type:Product="laptop" />
</dataset>
Ticket moved from /p/dbunit/bugs/403/
Can't be converted:
I'm not understanding why we would want to mimic DDL/table config in dbUnit. The dbUnit tables are representing data for insert or comparison.
Hi,
but how you will know how to insert data, as VARCHAR or as PRODUCT type?
because https://gist.github.com/anonymous/01e3fd902271d713cff22ce35de084d6
throw exception
Any news about this issue?
Instead of changing the dataset, can dbUnit use the metadata to automatically determine the correct insert statement?
I suggest reviewing PostgresqlDataTypeFactory and processing around it to see if you can make something work.