When generating data using a postgres sequence (with DBSequenceGenerator), I get the following error:
java.lang.RuntimeException: Error executing query: select sequence_name, start_value, increment_by, max_value, min_value, is_cycled, cache_value, last_value from accounts_id_seq
at com.rapiddweller.jdbacl.DBUtil.executeQuery (DBUtil.java:1014)
at com.rapiddweller.jdbacl.DBUtil.querySingleRow (DBUtil.java:946)
at com.rapiddweller.jdbacl.dialect.PostgreSQLDialect.querySequences (PostgreSQLDialect.java:93)
Caused by: org.postgresql.util.PSQLException: ERROR: column "sequence_name" does not exist
Position: 8
<?xml version="1.0" encoding="UTF-8"?>
<setup xmlns="https://www.benerator.de/schema/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.benerator.de/schema/2.0.0-jdk-11 benerator-2.0.0.xsd"
defaultEncoding="UTF-8"
defaultDataset="US"
defaultLocale="en_US"
defaultLineSeparator="\n">
<import platforms="db"/>
<echo>
Populates a database
</echo>
<echo>defining a database that will be referred by the id 'db' later</echo>
<database id="db"
url="jdbc:postgresql://localhost:5432/postgres"
driver="org.postgresql.Driver"
schema="public"
user="postgres"
password="postgres"/>
<echo>Drop the testtable if it already exist. If it does not exist yet, the error message is ignored</echo>
<execute target="db" type="sql" onError="ignore">
DROP SEQUENCE IF EXISTS accounts_id_seq;
DROP TABLE IF EXISTS accounts;
</execute>
<echo>Creating testtable</echo>
<execute target="db" type="sql">
CREATE SEQUENCE accounts_id_seq;
CREATE TABLE accounts (
user_id BIGINT PRIMARY KEY,
username VARCHAR ( 50 ) UNIQUE NOT NULL
);
</execute>
<echo>Generating 100 entries for testtable</echo>
<generate type="accounts" consumer="db,ConsoleExporter" count="100">
<id name="id" type="long"
generator="new DBSequenceGenerator('accounts_id_seq', db, true)"/>
</generate>
</setup>
Data generation with a sequence should work.