Skip to content

Commit dc834cb

Browse files
Support flex annotation in FlatBuffers schema.
1 parent 2dc45f5 commit dc834cb

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

internal/generator/c/schema-reader.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var supportedEntityAnnotations = map[string]bool{
4141
var supportedPropertyAnnotations = map[string]bool{
4242
"date": true,
4343
"date-nano": true,
44+
"flex": true,
4445
"id": true,
4546
"id-companion": true,
4647
"index": true,

test/comparison/testdata/fbs/typeful/objectbox-model.json.expected

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
},
139139
{
140140
"id": "2:2259404117704393152",
141-
"lastPropertyId": "9:6972732843819909978",
141+
"lastPropertyId": "10:7845762441295307478",
142142
"name": "AnnotatedEntity",
143143
"flags": 2,
144144
"properties": [
@@ -202,6 +202,11 @@
202202
"indexId": "8:5558237345453186302",
203203
"type": 5,
204204
"flags": 40
205+
},
206+
{
207+
"id": "10:7845762441295307478",
208+
"name": "flexValue",
209+
"type": 13
205210
}
206211
],
207212
"relations": [

test/comparison/testdata/fbs/typeful/schema.fbs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ table Annotated {
6868
/// unique on string without index type implies HASH index
6969
/// objectbox:unique
7070
uid:int;
71+
72+
/// mark byte vector as flexible type
73+
/// objectbox:flex
74+
flexValue:[byte];
7175
}
7276

7377
/// objectbox: transient

0 commit comments

Comments
 (0)