-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenerator.xml
43 lines (36 loc) · 1.4 KB
/
benerator.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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">
<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 TABLE IF EXISTS accounts;
</execute>
<echo>Creating testtable</echo>
<execute target="db" type="sql">
CREATE TABLE accounts (
user_id serial PRIMARY KEY,
username VARCHAR ( 50 ) UNIQUE NOT NULL,
user_uuid uuid UNIQUE NOT NULL
);
</execute>
<echo>Generating 100 entries for testtable</echo>
<generate type="accounts" consumer="db,ConsoleExporter" count="100">
<id name="id"/>
<attribute name="user_uuid" script="{java.util.UUID.randomUUID()}"/>
</generate>
</setup>