mobile bluesky app made with flutter
lazurite.stormlightlabs.org/
mobile
bluesky
flutter
1// GENERATED CODE - DO NOT MODIFY BY HAND
2// This code was generated by ObjectBox. To update it run the generator again
3// with `dart run build_runner build`.
4// See also https://docs.objectbox.io/getting-started#generate-objectbox-code
5
6// ignore_for_file: camel_case_types, depend_on_referenced_packages
7// coverage:ignore-file
8
9import 'dart:typed_data';
10
11import 'package:flat_buffers/flat_buffers.dart' as fb;
12import 'package:objectbox/internal.dart'
13 as obx_int; // generated code can access "internal" functionality
14import 'package:objectbox/objectbox.dart' as obx;
15import 'package:objectbox_flutter_libs/objectbox_flutter_libs.dart';
16
17import 'core/objectbox/embedded_post.dart';
18
19export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file
20
21final _entities = <obx_int.ModelEntity>[
22 obx_int.ModelEntity(
23 id: const obx_int.IdUid(1, 6999496775046459021),
24 name: 'EmbeddedPost',
25 lastPropertyId: const obx_int.IdUid(7, 8430059363224486218),
26 flags: 0,
27 properties: <obx_int.ModelProperty>[
28 obx_int.ModelProperty(
29 id: const obx_int.IdUid(1, 2023883478741600837),
30 name: 'id',
31 type: 6,
32 flags: 1,
33 ),
34 obx_int.ModelProperty(
35 id: const obx_int.IdUid(2, 3549521277099340373),
36 name: 'postUri',
37 type: 9,
38 flags: 2080,
39 indexId: const obx_int.IdUid(1, 4682420966856057445),
40 ),
41 obx_int.ModelProperty(
42 id: const obx_int.IdUid(3, 115219216497020018),
43 name: 'accountDid',
44 type: 9,
45 flags: 0,
46 ),
47 obx_int.ModelProperty(
48 id: const obx_int.IdUid(4, 2084589381727568380),
49 name: 'source',
50 type: 9,
51 flags: 0,
52 ),
53 obx_int.ModelProperty(
54 id: const obx_int.IdUid(5, 4494373135934411874),
55 name: 'indexedText',
56 type: 9,
57 flags: 0,
58 ),
59 obx_int.ModelProperty(
60 id: const obx_int.IdUid(6, 7790743710249736574),
61 name: 'embedding',
62 type: 28,
63 flags: 8,
64 indexId: const obx_int.IdUid(2, 7649439792027952584),
65 hnswParams: obx_int.ModelHnswParams(dimensions: 384, distanceType: 2),
66 ),
67 obx_int.ModelProperty(
68 id: const obx_int.IdUid(7, 8430059363224486218),
69 name: 'embeddedAt',
70 type: 12,
71 flags: 0,
72 ),
73 ],
74 relations: <obx_int.ModelRelation>[],
75 backlinks: <obx_int.ModelBacklink>[],
76 ),
77];
78
79/// Shortcut for [obx.Store.new] that passes [getObjectBoxModel] and for Flutter
80/// apps by default a [directory] using `defaultStoreDirectory()` from the
81/// ObjectBox Flutter library.
82///
83/// Note: for desktop apps it is recommended to specify a unique [directory].
84///
85/// See [obx.Store.new] for an explanation of all parameters.
86///
87/// For Flutter apps, also calls `loadObjectBoxLibraryAndroidCompat()` from
88/// the ObjectBox Flutter library to fix loading the native ObjectBox library
89/// on Android 6 and older.
90Future<obx.Store> openStore({
91 String? directory,
92 int? maxDBSizeInKB,
93 int? maxDataSizeInKB,
94 int? fileMode,
95 int? maxReaders,
96 bool queriesCaseSensitiveDefault = true,
97 String? macosApplicationGroup,
98}) async {
99 await loadObjectBoxLibraryAndroidCompat();
100 return obx.Store(
101 getObjectBoxModel(),
102 directory: directory ?? (await defaultStoreDirectory()).path,
103 maxDBSizeInKB: maxDBSizeInKB,
104 maxDataSizeInKB: maxDataSizeInKB,
105 fileMode: fileMode,
106 maxReaders: maxReaders,
107 queriesCaseSensitiveDefault: queriesCaseSensitiveDefault,
108 macosApplicationGroup: macosApplicationGroup,
109 );
110}
111
112/// Returns the ObjectBox model definition for this project for use with
113/// [obx.Store.new].
114obx_int.ModelDefinition getObjectBoxModel() {
115 final model = obx_int.ModelInfo(
116 // If this version is not found, it means that this file was generated
117 // with an older version of the ObjectBox Dart generator.
118 // Please regenerate this file with the current generator version.
119 // Typically, this is done with `dart run build_runner build`.
120 generatorVersion: obx_int.GeneratorVersion.v2025_12_16,
121 entities: _entities,
122 lastEntityId: const obx_int.IdUid(1, 6999496775046459021),
123 lastIndexId: const obx_int.IdUid(2, 7649439792027952584),
124 lastRelationId: const obx_int.IdUid(0, 0),
125 lastSequenceId: const obx_int.IdUid(0, 0),
126 retiredEntityUids: const [],
127 retiredIndexUids: const [],
128 retiredPropertyUids: const [],
129 retiredRelationUids: const [],
130 modelVersion: 5,
131 modelVersionParserMinimum: 5,
132 version: 1,
133 );
134
135 final bindings = <Type, obx_int.EntityDefinition>{
136 EmbeddedPost: obx_int.EntityDefinition<EmbeddedPost>(
137 model: _entities[0],
138 toOneRelations: (EmbeddedPost object) => [],
139 toManyRelations: (EmbeddedPost object) => {},
140 getId: (EmbeddedPost object) => object.id,
141 setId: (EmbeddedPost object, int id) {
142 object.id = id;
143 },
144 objectToFB: (EmbeddedPost object, fb.Builder fbb) {
145 final postUriOffset = fbb.writeString(object.postUri);
146 final accountDidOffset = fbb.writeString(object.accountDid);
147 final sourceOffset = fbb.writeString(object.source);
148 final indexedTextOffset = fbb.writeString(object.indexedText);
149 final embeddingOffset = object.embedding == null
150 ? null
151 : fbb.writeListFloat32(object.embedding!);
152 fbb.startTable(8);
153 fbb.addInt64(0, object.id);
154 fbb.addOffset(1, postUriOffset);
155 fbb.addOffset(2, accountDidOffset);
156 fbb.addOffset(3, sourceOffset);
157 fbb.addOffset(4, indexedTextOffset);
158 fbb.addOffset(5, embeddingOffset);
159 fbb.addInt64(6, object.embeddedAt.microsecondsSinceEpoch * 1000);
160 fbb.finish(fbb.endTable());
161 return object.id;
162 },
163 objectFromFB: (obx.Store store, ByteData fbData) {
164 final buffer = fb.BufferContext(fbData);
165 final rootOffset = buffer.derefObject(0);
166 final idParam = const fb.Int64Reader().vTableGet(
167 buffer,
168 rootOffset,
169 4,
170 0,
171 );
172 final postUriParam = const fb.StringReader(
173 asciiOptimization: true,
174 ).vTableGet(buffer, rootOffset, 6, '');
175 final accountDidParam = const fb.StringReader(
176 asciiOptimization: true,
177 ).vTableGet(buffer, rootOffset, 8, '');
178 final sourceParam = const fb.StringReader(
179 asciiOptimization: true,
180 ).vTableGet(buffer, rootOffset, 10, '');
181 final indexedTextParam = const fb.StringReader(
182 asciiOptimization: true,
183 ).vTableGet(buffer, rootOffset, 12, '');
184 final embeddingParam = const fb.ListReader<double>(
185 fb.Float32Reader(),
186 lazy: false,
187 ).vTableGetNullable(buffer, rootOffset, 14);
188 final embeddedAtParam = DateTime.fromMicrosecondsSinceEpoch(
189 (const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0) / 1000)
190 .round(),
191 );
192 final object = EmbeddedPost(
193 id: idParam,
194 postUri: postUriParam,
195 accountDid: accountDidParam,
196 source: sourceParam,
197 indexedText: indexedTextParam,
198 embedding: embeddingParam,
199 embeddedAt: embeddedAtParam,
200 );
201
202 return object;
203 },
204 ),
205 };
206
207 return obx_int.ModelDefinition(model, bindings);
208}
209
210/// [EmbeddedPost] entity fields to define ObjectBox queries.
211class EmbeddedPost_ {
212 /// See [EmbeddedPost.id].
213 static final id = obx.QueryIntegerProperty<EmbeddedPost>(
214 _entities[0].properties[0],
215 );
216
217 /// See [EmbeddedPost.postUri].
218 static final postUri = obx.QueryStringProperty<EmbeddedPost>(
219 _entities[0].properties[1],
220 );
221
222 /// See [EmbeddedPost.accountDid].
223 static final accountDid = obx.QueryStringProperty<EmbeddedPost>(
224 _entities[0].properties[2],
225 );
226
227 /// See [EmbeddedPost.source].
228 static final source = obx.QueryStringProperty<EmbeddedPost>(
229 _entities[0].properties[3],
230 );
231
232 /// See [EmbeddedPost.indexedText].
233 static final indexedText = obx.QueryStringProperty<EmbeddedPost>(
234 _entities[0].properties[4],
235 );
236
237 /// See [EmbeddedPost.embedding].
238 static final embedding = obx.QueryHnswProperty<EmbeddedPost>(
239 _entities[0].properties[5],
240 );
241
242 /// See [EmbeddedPost.embeddedAt].
243 static final embeddedAt = obx.QueryDateNanoProperty<EmbeddedPost>(
244 _entities[0].properties[6],
245 );
246}