Skip to content

Conversation

bevzzz
Copy link
Collaborator

@bevzzz bevzzz commented Sep 8, 2025

@Collection("CoolThings", description = "It's where we store cool stuff")
record Thing(
  @Property("title") String name,
  UUID internalID,
  UUID[] similarItems,
  List<Short> availableSizes
  OffsetDateTime lastOrdered,
  boolean internationalShipping
) {}

client.collections.create(Thing.class);

var things = client.collections.use(Thing.class);
var blueShirt = things.data.insert(new Thing("blue shirt", ...));

var blueThings = things.query.bm25("blue", q -> q.queryProperties("name"));
System.out.println(
  "A blue thing was ordered at " + blueThings.objects().get(0).lastOrdered()
);

Limitation: this currently does not support BLOB data type, as it is practically a "String" and there's no distinction at the moment.

Supports text/int/number and corresponding array type properties.
- boolean/boolea[]
- date/date[]
- uuid/uuid[]

Blob type currently not supported, as it's not exactly clear
how best to distinguish it from normal String.
internal.orm package now knows how to marshal
and scan the response back into custom class instances.
To simplify the implementation, we only support 'record'
types for the moment, because they are final classes and
do not have an 'extends' clause.

Array[] and List() containers are supported,
other container types not.
@bevzzz bevzzz self-assigned this Sep 8, 2025
@bevzzz bevzzz marked this pull request as draft September 8, 2025 17:31
Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@bevzzz bevzzz marked this pull request as ready for review September 16, 2025 12:45
@bevzzz bevzzz merged commit 2cea539 into v6 Sep 19, 2025
2 checks passed
@bevzzz bevzzz deleted the v6-orm branch September 19, 2025 10:45
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