Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for array and multiset #489

Merged
merged 1 commit into from
Oct 24, 2022
Merged

Conversation

snuyanzin
Copy link
Collaborator

@snuyanzin snuyanzin commented Oct 24, 2022

Some databases support ARRAY and MULTISET
this PR adds support for it.
So if there is a field in Schema with value of array or list then it will be transformed into sql ARRAY
like

Schema.of(field("bytes", () -> new byte[]{1, 0}));

With help of this Schema there could be generated sql like

INSERT INTO "MyTable" ("bytes") VALUES (ARRAY[1, 0]);

In a similar way for MULTISET, a filed should be a set like

Schema.of(field("names_multiset", () -> Collections.singleton(faker.name().firstName())));

it could generate a sql like

INSERT INTO "MyTable" ("names_multiset") VALUES (MULTISET['Carlena']);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant