posixlake 0.1.6__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
posixlake/posixlake.py ADDED
@@ -0,0 +1,3222 @@
1
+
2
+
3
+ # This file was autogenerated by some hot garbage in the `uniffi` crate.
4
+ # Trust me, you don't want to mess with it!
5
+
6
+ # Common helper code.
7
+ #
8
+ # Ideally this would live in a separate .py file where it can be unittested etc
9
+ # in isolation, and perhaps even published as a re-useable package.
10
+ #
11
+ # However, it's important that the details of how this helper code works (e.g. the
12
+ # way that different builtin types are passed across the FFI) exactly match what's
13
+ # expected by the rust code on the other side of the interface. In practice right
14
+ # now that means coming from the exact some version of `uniffi` that was used to
15
+ # compile the rust component. The easiest way to ensure this is to bundle the Python
16
+ # helpers directly inline like we're doing here.
17
+
18
+ from __future__ import annotations
19
+ import os
20
+ import sys
21
+ import ctypes
22
+ import enum
23
+ import struct
24
+ import contextlib
25
+ import datetime
26
+ import threading
27
+ import itertools
28
+ import traceback
29
+ import typing
30
+ import platform
31
+
32
+ # Used for default argument values
33
+ _DEFAULT = object() # type: typing.Any
34
+
35
+
36
+ class _UniffiRustBuffer(ctypes.Structure):
37
+ _fields_ = [
38
+ ("capacity", ctypes.c_uint64),
39
+ ("len", ctypes.c_uint64),
40
+ ("data", ctypes.POINTER(ctypes.c_char)),
41
+ ]
42
+
43
+ @staticmethod
44
+ def default():
45
+ return _UniffiRustBuffer(0, 0, None)
46
+
47
+ @staticmethod
48
+ def alloc(size):
49
+ return _uniffi_rust_call(_UniffiLib.ffi_posixlake_rustbuffer_alloc, size)
50
+
51
+ @staticmethod
52
+ def reserve(rbuf, additional):
53
+ return _uniffi_rust_call(_UniffiLib.ffi_posixlake_rustbuffer_reserve, rbuf, additional)
54
+
55
+ def free(self):
56
+ return _uniffi_rust_call(_UniffiLib.ffi_posixlake_rustbuffer_free, self)
57
+
58
+ def __str__(self):
59
+ return "_UniffiRustBuffer(capacity={}, len={}, data={})".format(
60
+ self.capacity,
61
+ self.len,
62
+ self.data[0:self.len]
63
+ )
64
+
65
+ @contextlib.contextmanager
66
+ def alloc_with_builder(*args):
67
+ """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder.
68
+
69
+ The allocated buffer will be automatically freed if an error occurs, ensuring that
70
+ we don't accidentally leak it.
71
+ """
72
+ builder = _UniffiRustBufferBuilder()
73
+ try:
74
+ yield builder
75
+ except:
76
+ builder.discard()
77
+ raise
78
+
79
+ @contextlib.contextmanager
80
+ def consume_with_stream(self):
81
+ """Context-manager to consume a buffer using a _UniffiRustBufferStream.
82
+
83
+ The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't
84
+ leak it even if an error occurs.
85
+ """
86
+ try:
87
+ s = _UniffiRustBufferStream.from_rust_buffer(self)
88
+ yield s
89
+ if s.remaining() != 0:
90
+ raise RuntimeError("junk data left in buffer at end of consume_with_stream")
91
+ finally:
92
+ self.free()
93
+
94
+ @contextlib.contextmanager
95
+ def read_with_stream(self):
96
+ """Context-manager to read a buffer using a _UniffiRustBufferStream.
97
+
98
+ This is like consume_with_stream, but doesn't free the buffer afterwards.
99
+ It should only be used with borrowed `_UniffiRustBuffer` data.
100
+ """
101
+ s = _UniffiRustBufferStream.from_rust_buffer(self)
102
+ yield s
103
+ if s.remaining() != 0:
104
+ raise RuntimeError("junk data left in buffer at end of read_with_stream")
105
+
106
+ class _UniffiForeignBytes(ctypes.Structure):
107
+ _fields_ = [
108
+ ("len", ctypes.c_int32),
109
+ ("data", ctypes.POINTER(ctypes.c_char)),
110
+ ]
111
+
112
+ def __str__(self):
113
+ return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len])
114
+
115
+
116
+ class _UniffiRustBufferStream:
117
+ """
118
+ Helper for structured reading of bytes from a _UniffiRustBuffer
119
+ """
120
+
121
+ def __init__(self, data, len):
122
+ self.data = data
123
+ self.len = len
124
+ self.offset = 0
125
+
126
+ @classmethod
127
+ def from_rust_buffer(cls, buf):
128
+ return cls(buf.data, buf.len)
129
+
130
+ def remaining(self):
131
+ return self.len - self.offset
132
+
133
+ def _unpack_from(self, size, format):
134
+ if self.offset + size > self.len:
135
+ raise InternalError("read past end of rust buffer")
136
+ value = struct.unpack(format, self.data[self.offset:self.offset+size])[0]
137
+ self.offset += size
138
+ return value
139
+
140
+ def read(self, size):
141
+ if self.offset + size > self.len:
142
+ raise InternalError("read past end of rust buffer")
143
+ data = self.data[self.offset:self.offset+size]
144
+ self.offset += size
145
+ return data
146
+
147
+ def read_i8(self):
148
+ return self._unpack_from(1, ">b")
149
+
150
+ def read_u8(self):
151
+ return self._unpack_from(1, ">B")
152
+
153
+ def read_i16(self):
154
+ return self._unpack_from(2, ">h")
155
+
156
+ def read_u16(self):
157
+ return self._unpack_from(2, ">H")
158
+
159
+ def read_i32(self):
160
+ return self._unpack_from(4, ">i")
161
+
162
+ def read_u32(self):
163
+ return self._unpack_from(4, ">I")
164
+
165
+ def read_i64(self):
166
+ return self._unpack_from(8, ">q")
167
+
168
+ def read_u64(self):
169
+ return self._unpack_from(8, ">Q")
170
+
171
+ def read_float(self):
172
+ v = self._unpack_from(4, ">f")
173
+ return v
174
+
175
+ def read_double(self):
176
+ return self._unpack_from(8, ">d")
177
+
178
+ class _UniffiRustBufferBuilder:
179
+ """
180
+ Helper for structured writing of bytes into a _UniffiRustBuffer.
181
+ """
182
+
183
+ def __init__(self):
184
+ self.rbuf = _UniffiRustBuffer.alloc(16)
185
+ self.rbuf.len = 0
186
+
187
+ def finalize(self):
188
+ rbuf = self.rbuf
189
+ self.rbuf = None
190
+ return rbuf
191
+
192
+ def discard(self):
193
+ if self.rbuf is not None:
194
+ rbuf = self.finalize()
195
+ rbuf.free()
196
+
197
+ @contextlib.contextmanager
198
+ def _reserve(self, num_bytes):
199
+ if self.rbuf.len + num_bytes > self.rbuf.capacity:
200
+ self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes)
201
+ yield None
202
+ self.rbuf.len += num_bytes
203
+
204
+ def _pack_into(self, size, format, value):
205
+ with self._reserve(size):
206
+ # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out.
207
+ for i, byte in enumerate(struct.pack(format, value)):
208
+ self.rbuf.data[self.rbuf.len + i] = byte
209
+
210
+ def write(self, value):
211
+ with self._reserve(len(value)):
212
+ for i, byte in enumerate(value):
213
+ self.rbuf.data[self.rbuf.len + i] = byte
214
+
215
+ def write_i8(self, v):
216
+ self._pack_into(1, ">b", v)
217
+
218
+ def write_u8(self, v):
219
+ self._pack_into(1, ">B", v)
220
+
221
+ def write_i16(self, v):
222
+ self._pack_into(2, ">h", v)
223
+
224
+ def write_u16(self, v):
225
+ self._pack_into(2, ">H", v)
226
+
227
+ def write_i32(self, v):
228
+ self._pack_into(4, ">i", v)
229
+
230
+ def write_u32(self, v):
231
+ self._pack_into(4, ">I", v)
232
+
233
+ def write_i64(self, v):
234
+ self._pack_into(8, ">q", v)
235
+
236
+ def write_u64(self, v):
237
+ self._pack_into(8, ">Q", v)
238
+
239
+ def write_float(self, v):
240
+ self._pack_into(4, ">f", v)
241
+
242
+ def write_double(self, v):
243
+ self._pack_into(8, ">d", v)
244
+
245
+ def write_c_size_t(self, v):
246
+ self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v)
247
+ # A handful of classes and functions to support the generated data structures.
248
+ # This would be a good candidate for isolating in its own ffi-support lib.
249
+
250
+ class InternalError(Exception):
251
+ pass
252
+
253
+ class _UniffiRustCallStatus(ctypes.Structure):
254
+ """
255
+ Error runtime.
256
+ """
257
+ _fields_ = [
258
+ ("code", ctypes.c_int8),
259
+ ("error_buf", _UniffiRustBuffer),
260
+ ]
261
+
262
+ # These match the values from the uniffi::rustcalls module
263
+ CALL_SUCCESS = 0
264
+ CALL_ERROR = 1
265
+ CALL_UNEXPECTED_ERROR = 2
266
+
267
+ @staticmethod
268
+ def default():
269
+ return _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer.default())
270
+
271
+ def __str__(self):
272
+ if self.code == _UniffiRustCallStatus.CALL_SUCCESS:
273
+ return "_UniffiRustCallStatus(CALL_SUCCESS)"
274
+ elif self.code == _UniffiRustCallStatus.CALL_ERROR:
275
+ return "_UniffiRustCallStatus(CALL_ERROR)"
276
+ elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR:
277
+ return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)"
278
+ else:
279
+ return "_UniffiRustCallStatus(<invalid code>)"
280
+
281
+ def _uniffi_rust_call(fn, *args):
282
+ # Call a rust function
283
+ return _uniffi_rust_call_with_error(None, fn, *args)
284
+
285
+ def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args):
286
+ # Call a rust function and handle any errors
287
+ #
288
+ # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code.
289
+ # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result.
290
+ call_status = _UniffiRustCallStatus.default()
291
+
292
+ args_with_error = args + (ctypes.byref(call_status),)
293
+ result = fn(*args_with_error)
294
+ _uniffi_check_call_status(error_ffi_converter, call_status)
295
+ return result
296
+
297
+ def _uniffi_check_call_status(error_ffi_converter, call_status):
298
+ if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS:
299
+ pass
300
+ elif call_status.code == _UniffiRustCallStatus.CALL_ERROR:
301
+ if error_ffi_converter is None:
302
+ call_status.error_buf.free()
303
+ raise InternalError("_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None")
304
+ else:
305
+ raise error_ffi_converter.lift(call_status.error_buf)
306
+ elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR:
307
+ # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer
308
+ # with the message. But if that code panics, then it just sends back
309
+ # an empty buffer.
310
+ if call_status.error_buf.len > 0:
311
+ msg = _UniffiConverterString.lift(call_status.error_buf)
312
+ else:
313
+ msg = "Unknown rust panic"
314
+ raise InternalError(msg)
315
+ else:
316
+ raise InternalError("Invalid _UniffiRustCallStatus code: {}".format(
317
+ call_status.code))
318
+
319
+ def _uniffi_trait_interface_call(call_status, make_call, write_return_value):
320
+ try:
321
+ return write_return_value(make_call())
322
+ except Exception as e:
323
+ call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR
324
+ call_status.error_buf = _UniffiConverterString.lower(repr(e))
325
+
326
+ def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error):
327
+ try:
328
+ try:
329
+ return write_return_value(make_call())
330
+ except error_type as e:
331
+ call_status.code = _UniffiRustCallStatus.CALL_ERROR
332
+ call_status.error_buf = lower_error(e)
333
+ except Exception as e:
334
+ call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR
335
+ call_status.error_buf = _UniffiConverterString.lower(repr(e))
336
+ class _UniffiHandleMap:
337
+ """
338
+ A map where inserting, getting and removing data is synchronized with a lock.
339
+ """
340
+
341
+ def __init__(self):
342
+ # type Handle = int
343
+ self._map = {} # type: Dict[Handle, Any]
344
+ self._lock = threading.Lock()
345
+ self._counter = itertools.count()
346
+
347
+ def insert(self, obj):
348
+ with self._lock:
349
+ handle = next(self._counter)
350
+ self._map[handle] = obj
351
+ return handle
352
+
353
+ def get(self, handle):
354
+ try:
355
+ with self._lock:
356
+ return self._map[handle]
357
+ except KeyError:
358
+ raise InternalError("_UniffiHandleMap.get: Invalid handle")
359
+
360
+ def remove(self, handle):
361
+ try:
362
+ with self._lock:
363
+ return self._map.pop(handle)
364
+ except KeyError:
365
+ raise InternalError("_UniffiHandleMap.remove: Invalid handle")
366
+
367
+ def __len__(self):
368
+ return len(self._map)
369
+ # Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI.
370
+ class _UniffiConverterPrimitive:
371
+ @classmethod
372
+ def lift(cls, value):
373
+ return value
374
+
375
+ @classmethod
376
+ def lower(cls, value):
377
+ return value
378
+
379
+ class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive):
380
+ @classmethod
381
+ def check_lower(cls, value):
382
+ try:
383
+ value = value.__index__()
384
+ except Exception:
385
+ raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__))
386
+ if not isinstance(value, int):
387
+ raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__))
388
+ if not cls.VALUE_MIN <= value < cls.VALUE_MAX:
389
+ raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX))
390
+
391
+ class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive):
392
+ @classmethod
393
+ def check_lower(cls, value):
394
+ try:
395
+ value = value.__float__()
396
+ except Exception:
397
+ raise TypeError("must be real number, not {}".format(type(value).__name__))
398
+ if not isinstance(value, float):
399
+ raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__))
400
+
401
+ # Helper class for wrapper types that will always go through a _UniffiRustBuffer.
402
+ # Classes should inherit from this and implement the `read` and `write` static methods.
403
+ class _UniffiConverterRustBuffer:
404
+ @classmethod
405
+ def lift(cls, rbuf):
406
+ with rbuf.consume_with_stream() as stream:
407
+ return cls.read(stream)
408
+
409
+ @classmethod
410
+ def lower(cls, value):
411
+ with _UniffiRustBuffer.alloc_with_builder() as builder:
412
+ cls.write(value, builder)
413
+ return builder.finalize()
414
+
415
+ # Contains loading, initialization code, and the FFI Function declarations.
416
+ # Define some ctypes FFI types that we use in the library
417
+
418
+ """
419
+ Function pointer for a Rust task, which a callback function that takes a opaque pointer
420
+ """
421
+ _UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8)
422
+
423
+ def _uniffi_future_callback_t(return_type):
424
+ """
425
+ Factory function to create callback function types for async functions
426
+ """
427
+ return ctypes.CFUNCTYPE(None, ctypes.c_uint64, return_type, _UniffiRustCallStatus)
428
+
429
+ def _uniffi_load_indirect():
430
+ """
431
+ This is how we find and load the dynamic library provided by the component.
432
+ For now we just look it up by name.
433
+ """
434
+ if sys.platform == "darwin":
435
+ libname = "lib{}.dylib"
436
+ elif sys.platform.startswith("win"):
437
+ # As of python3.8, ctypes does not seem to search $PATH when loading DLLs.
438
+ # We could use `os.add_dll_directory` to configure the search path, but
439
+ # it doesn't feel right to mess with application-wide settings. Let's
440
+ # assume that the `.dll` is next to the `.py` file and load by full path.
441
+ libname = os.path.join(
442
+ os.path.dirname(__file__),
443
+ "{}.dll",
444
+ )
445
+ else:
446
+ # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos
447
+ libname = "lib{}.so"
448
+
449
+ libname = libname.format("posixlake")
450
+ path = os.path.join(os.path.dirname(__file__), libname)
451
+ lib = ctypes.cdll.LoadLibrary(path)
452
+ return lib
453
+
454
+ def _uniffi_check_contract_api_version(lib):
455
+ # Get the bindings contract version from our ComponentInterface
456
+ bindings_contract_version = 29
457
+ # Get the scaffolding contract version by calling the into the dylib
458
+ scaffolding_contract_version = lib.ffi_posixlake_uniffi_contract_version()
459
+ if bindings_contract_version != scaffolding_contract_version:
460
+ raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
461
+
462
+ def _uniffi_check_api_checksums(lib):
463
+ if lib.uniffi_posixlake_checksum_func_restore() != 17475:
464
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
465
+ if lib.uniffi_posixlake_checksum_func_restore_to_transaction() != 46731:
466
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
467
+ if lib.uniffi_posixlake_checksum_method_databaseops_backup() != 40091:
468
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
469
+ if lib.uniffi_posixlake_checksum_method_databaseops_backup_incremental() != 37258:
470
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
471
+ if lib.uniffi_posixlake_checksum_method_databaseops_create_user() != 52989:
472
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
473
+ if lib.uniffi_posixlake_checksum_method_databaseops_delete_rows_where() != 42512:
474
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
475
+ if lib.uniffi_posixlake_checksum_method_databaseops_flush_write_buffer() != 10531:
476
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
477
+ if lib.uniffi_posixlake_checksum_method_databaseops_get_base_path() != 47197:
478
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
479
+ if lib.uniffi_posixlake_checksum_method_databaseops_get_data_skipping_stats() != 4630:
480
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
481
+ if lib.uniffi_posixlake_checksum_method_databaseops_get_metrics() != 10926:
482
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
483
+ if lib.uniffi_posixlake_checksum_method_databaseops_get_schema() != 65268:
484
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
485
+ if lib.uniffi_posixlake_checksum_method_databaseops_health_check() != 45840:
486
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
487
+ if lib.uniffi_posixlake_checksum_method_databaseops_insert_buffered_json() != 21120:
488
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
489
+ if lib.uniffi_posixlake_checksum_method_databaseops_insert_json() != 50056:
490
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
491
+ if lib.uniffi_posixlake_checksum_method_databaseops_merge_json() != 33646:
492
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
493
+ if lib.uniffi_posixlake_checksum_method_databaseops_optimize() != 8462:
494
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
495
+ if lib.uniffi_posixlake_checksum_method_databaseops_optimize_with_filter() != 20703:
496
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
497
+ if lib.uniffi_posixlake_checksum_method_databaseops_optimize_with_target_size() != 43273:
498
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
499
+ if lib.uniffi_posixlake_checksum_method_databaseops_query() != 58339:
500
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
501
+ if lib.uniffi_posixlake_checksum_method_databaseops_query_json() != 44263:
502
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
503
+ if lib.uniffi_posixlake_checksum_method_databaseops_query_timestamp() != 27436:
504
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
505
+ if lib.uniffi_posixlake_checksum_method_databaseops_query_timestamp_json() != 23913:
506
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
507
+ if lib.uniffi_posixlake_checksum_method_databaseops_query_version() != 26283:
508
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
509
+ if lib.uniffi_posixlake_checksum_method_databaseops_query_version_json() != 6541:
510
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
511
+ if lib.uniffi_posixlake_checksum_method_databaseops_vacuum() != 65393:
512
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
513
+ if lib.uniffi_posixlake_checksum_method_databaseops_vacuum_dry_run() != 29844:
514
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
515
+ if lib.uniffi_posixlake_checksum_method_databaseops_zorder() != 7354:
516
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
517
+ if lib.uniffi_posixlake_checksum_method_nfsserver_get_mount_command() != 40395:
518
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
519
+ if lib.uniffi_posixlake_checksum_method_nfsserver_get_port() != 19319:
520
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
521
+ if lib.uniffi_posixlake_checksum_method_nfsserver_get_unmount_command() != 62307:
522
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
523
+ if lib.uniffi_posixlake_checksum_method_nfsserver_is_ready() != 63793:
524
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
525
+ if lib.uniffi_posixlake_checksum_method_nfsserver_shutdown() != 27868:
526
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
527
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_create() != 56590:
528
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
529
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_create_from_csv() != 33604:
530
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
531
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_create_from_parquet() != 47261:
532
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
533
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_create_with_auth() != 43173:
534
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
535
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_create_with_s3() != 9824:
536
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
537
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_open() != 3718:
538
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
539
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_open_with_credentials() != 21963:
540
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
541
+ if lib.uniffi_posixlake_checksum_constructor_databaseops_open_with_s3() != 24796:
542
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
543
+ if lib.uniffi_posixlake_checksum_constructor_nfsserver_new() != 18383:
544
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
545
+
546
+ # A ctypes library to expose the extern-C FFI definitions.
547
+ # This is an implementation detail which will be called internally by the public API.
548
+
549
+ _UniffiLib = _uniffi_load_indirect()
550
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8,
551
+ )
552
+ _UNIFFI_FOREIGN_FUTURE_FREE = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
553
+ )
554
+ _UNIFFI_CALLBACK_INTERFACE_FREE = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
555
+ )
556
+ class _UniffiForeignFuture(ctypes.Structure):
557
+ _fields_ = [
558
+ ("handle", ctypes.c_uint64),
559
+ ("free", _UNIFFI_FOREIGN_FUTURE_FREE),
560
+ ]
561
+ class _UniffiForeignFutureStructU8(ctypes.Structure):
562
+ _fields_ = [
563
+ ("return_value", ctypes.c_uint8),
564
+ ("call_status", _UniffiRustCallStatus),
565
+ ]
566
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_U8 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructU8,
567
+ )
568
+ class _UniffiForeignFutureStructI8(ctypes.Structure):
569
+ _fields_ = [
570
+ ("return_value", ctypes.c_int8),
571
+ ("call_status", _UniffiRustCallStatus),
572
+ ]
573
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_I8 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructI8,
574
+ )
575
+ class _UniffiForeignFutureStructU16(ctypes.Structure):
576
+ _fields_ = [
577
+ ("return_value", ctypes.c_uint16),
578
+ ("call_status", _UniffiRustCallStatus),
579
+ ]
580
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_U16 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructU16,
581
+ )
582
+ class _UniffiForeignFutureStructI16(ctypes.Structure):
583
+ _fields_ = [
584
+ ("return_value", ctypes.c_int16),
585
+ ("call_status", _UniffiRustCallStatus),
586
+ ]
587
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_I16 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructI16,
588
+ )
589
+ class _UniffiForeignFutureStructU32(ctypes.Structure):
590
+ _fields_ = [
591
+ ("return_value", ctypes.c_uint32),
592
+ ("call_status", _UniffiRustCallStatus),
593
+ ]
594
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_U32 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructU32,
595
+ )
596
+ class _UniffiForeignFutureStructI32(ctypes.Structure):
597
+ _fields_ = [
598
+ ("return_value", ctypes.c_int32),
599
+ ("call_status", _UniffiRustCallStatus),
600
+ ]
601
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_I32 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructI32,
602
+ )
603
+ class _UniffiForeignFutureStructU64(ctypes.Structure):
604
+ _fields_ = [
605
+ ("return_value", ctypes.c_uint64),
606
+ ("call_status", _UniffiRustCallStatus),
607
+ ]
608
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_U64 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructU64,
609
+ )
610
+ class _UniffiForeignFutureStructI64(ctypes.Structure):
611
+ _fields_ = [
612
+ ("return_value", ctypes.c_int64),
613
+ ("call_status", _UniffiRustCallStatus),
614
+ ]
615
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_I64 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructI64,
616
+ )
617
+ class _UniffiForeignFutureStructF32(ctypes.Structure):
618
+ _fields_ = [
619
+ ("return_value", ctypes.c_float),
620
+ ("call_status", _UniffiRustCallStatus),
621
+ ]
622
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_F32 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructF32,
623
+ )
624
+ class _UniffiForeignFutureStructF64(ctypes.Structure):
625
+ _fields_ = [
626
+ ("return_value", ctypes.c_double),
627
+ ("call_status", _UniffiRustCallStatus),
628
+ ]
629
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_F64 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructF64,
630
+ )
631
+ class _UniffiForeignFutureStructPointer(ctypes.Structure):
632
+ _fields_ = [
633
+ ("return_value", ctypes.c_void_p),
634
+ ("call_status", _UniffiRustCallStatus),
635
+ ]
636
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_POINTER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructPointer,
637
+ )
638
+ class _UniffiForeignFutureStructRustBuffer(ctypes.Structure):
639
+ _fields_ = [
640
+ ("return_value", _UniffiRustBuffer),
641
+ ("call_status", _UniffiRustCallStatus),
642
+ ]
643
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructRustBuffer,
644
+ )
645
+ class _UniffiForeignFutureStructVoid(ctypes.Structure):
646
+ _fields_ = [
647
+ ("call_status", _UniffiRustCallStatus),
648
+ ]
649
+ _UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructVoid,
650
+ )
651
+ _UniffiLib.uniffi_posixlake_fn_clone_databaseops.argtypes = (
652
+ ctypes.c_void_p,
653
+ ctypes.POINTER(_UniffiRustCallStatus),
654
+ )
655
+ _UniffiLib.uniffi_posixlake_fn_clone_databaseops.restype = ctypes.c_void_p
656
+ _UniffiLib.uniffi_posixlake_fn_free_databaseops.argtypes = (
657
+ ctypes.c_void_p,
658
+ ctypes.POINTER(_UniffiRustCallStatus),
659
+ )
660
+ _UniffiLib.uniffi_posixlake_fn_free_databaseops.restype = None
661
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create.argtypes = (
662
+ _UniffiRustBuffer,
663
+ _UniffiRustBuffer,
664
+ ctypes.POINTER(_UniffiRustCallStatus),
665
+ )
666
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create.restype = ctypes.c_void_p
667
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_from_csv.argtypes = (
668
+ _UniffiRustBuffer,
669
+ _UniffiRustBuffer,
670
+ ctypes.POINTER(_UniffiRustCallStatus),
671
+ )
672
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_from_csv.restype = ctypes.c_void_p
673
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_from_parquet.argtypes = (
674
+ _UniffiRustBuffer,
675
+ _UniffiRustBuffer,
676
+ ctypes.POINTER(_UniffiRustCallStatus),
677
+ )
678
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_from_parquet.restype = ctypes.c_void_p
679
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_with_auth.argtypes = (
680
+ _UniffiRustBuffer,
681
+ _UniffiRustBuffer,
682
+ ctypes.c_int8,
683
+ ctypes.POINTER(_UniffiRustCallStatus),
684
+ )
685
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_with_auth.restype = ctypes.c_void_p
686
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_with_s3.argtypes = (
687
+ _UniffiRustBuffer,
688
+ _UniffiRustBuffer,
689
+ _UniffiRustBuffer,
690
+ ctypes.POINTER(_UniffiRustCallStatus),
691
+ )
692
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_with_s3.restype = ctypes.c_void_p
693
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open.argtypes = (
694
+ _UniffiRustBuffer,
695
+ ctypes.POINTER(_UniffiRustCallStatus),
696
+ )
697
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open.restype = ctypes.c_void_p
698
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open_with_credentials.argtypes = (
699
+ _UniffiRustBuffer,
700
+ _UniffiRustBuffer,
701
+ _UniffiRustBuffer,
702
+ ctypes.POINTER(_UniffiRustCallStatus),
703
+ )
704
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open_with_credentials.restype = ctypes.c_void_p
705
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open_with_s3.argtypes = (
706
+ _UniffiRustBuffer,
707
+ _UniffiRustBuffer,
708
+ ctypes.POINTER(_UniffiRustCallStatus),
709
+ )
710
+ _UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open_with_s3.restype = ctypes.c_void_p
711
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_backup.argtypes = (
712
+ ctypes.c_void_p,
713
+ _UniffiRustBuffer,
714
+ ctypes.POINTER(_UniffiRustCallStatus),
715
+ )
716
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_backup.restype = None
717
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_backup_incremental.argtypes = (
718
+ ctypes.c_void_p,
719
+ _UniffiRustBuffer,
720
+ _UniffiRustBuffer,
721
+ ctypes.POINTER(_UniffiRustCallStatus),
722
+ )
723
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_backup_incremental.restype = None
724
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_create_user.argtypes = (
725
+ ctypes.c_void_p,
726
+ _UniffiRustBuffer,
727
+ _UniffiRustBuffer,
728
+ _UniffiRustBuffer,
729
+ ctypes.POINTER(_UniffiRustCallStatus),
730
+ )
731
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_create_user.restype = None
732
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_delete_rows_where.argtypes = (
733
+ ctypes.c_void_p,
734
+ _UniffiRustBuffer,
735
+ ctypes.POINTER(_UniffiRustCallStatus),
736
+ )
737
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_delete_rows_where.restype = ctypes.c_uint64
738
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_flush_write_buffer.argtypes = (
739
+ ctypes.c_void_p,
740
+ ctypes.POINTER(_UniffiRustCallStatus),
741
+ )
742
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_flush_write_buffer.restype = None
743
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_base_path.argtypes = (
744
+ ctypes.c_void_p,
745
+ ctypes.POINTER(_UniffiRustCallStatus),
746
+ )
747
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_base_path.restype = _UniffiRustBuffer
748
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_data_skipping_stats.argtypes = (
749
+ ctypes.c_void_p,
750
+ ctypes.POINTER(_UniffiRustCallStatus),
751
+ )
752
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_data_skipping_stats.restype = _UniffiRustBuffer
753
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_metrics.argtypes = (
754
+ ctypes.c_void_p,
755
+ ctypes.POINTER(_UniffiRustCallStatus),
756
+ )
757
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_metrics.restype = _UniffiRustBuffer
758
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_schema.argtypes = (
759
+ ctypes.c_void_p,
760
+ ctypes.POINTER(_UniffiRustCallStatus),
761
+ )
762
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_get_schema.restype = _UniffiRustBuffer
763
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_health_check.argtypes = (
764
+ ctypes.c_void_p,
765
+ ctypes.POINTER(_UniffiRustCallStatus),
766
+ )
767
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_health_check.restype = _UniffiRustBuffer
768
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_insert_buffered_json.argtypes = (
769
+ ctypes.c_void_p,
770
+ _UniffiRustBuffer,
771
+ ctypes.POINTER(_UniffiRustCallStatus),
772
+ )
773
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_insert_buffered_json.restype = ctypes.c_uint64
774
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_insert_json.argtypes = (
775
+ ctypes.c_void_p,
776
+ _UniffiRustBuffer,
777
+ ctypes.POINTER(_UniffiRustCallStatus),
778
+ )
779
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_insert_json.restype = ctypes.c_uint64
780
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_merge_json.argtypes = (
781
+ ctypes.c_void_p,
782
+ _UniffiRustBuffer,
783
+ _UniffiRustBuffer,
784
+ ctypes.POINTER(_UniffiRustCallStatus),
785
+ )
786
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_merge_json.restype = _UniffiRustBuffer
787
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize.argtypes = (
788
+ ctypes.c_void_p,
789
+ ctypes.POINTER(_UniffiRustCallStatus),
790
+ )
791
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize.restype = None
792
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize_with_filter.argtypes = (
793
+ ctypes.c_void_p,
794
+ _UniffiRustBuffer,
795
+ ctypes.POINTER(_UniffiRustCallStatus),
796
+ )
797
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize_with_filter.restype = None
798
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize_with_target_size.argtypes = (
799
+ ctypes.c_void_p,
800
+ ctypes.c_uint64,
801
+ ctypes.POINTER(_UniffiRustCallStatus),
802
+ )
803
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize_with_target_size.restype = None
804
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query.argtypes = (
805
+ ctypes.c_void_p,
806
+ _UniffiRustBuffer,
807
+ ctypes.POINTER(_UniffiRustCallStatus),
808
+ )
809
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query.restype = _UniffiRustBuffer
810
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_json.argtypes = (
811
+ ctypes.c_void_p,
812
+ _UniffiRustBuffer,
813
+ ctypes.POINTER(_UniffiRustCallStatus),
814
+ )
815
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_json.restype = _UniffiRustBuffer
816
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_timestamp.argtypes = (
817
+ ctypes.c_void_p,
818
+ _UniffiRustBuffer,
819
+ ctypes.c_int64,
820
+ ctypes.POINTER(_UniffiRustCallStatus),
821
+ )
822
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_timestamp.restype = _UniffiRustBuffer
823
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_timestamp_json.argtypes = (
824
+ ctypes.c_void_p,
825
+ _UniffiRustBuffer,
826
+ ctypes.c_int64,
827
+ ctypes.POINTER(_UniffiRustCallStatus),
828
+ )
829
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_timestamp_json.restype = _UniffiRustBuffer
830
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_version.argtypes = (
831
+ ctypes.c_void_p,
832
+ _UniffiRustBuffer,
833
+ ctypes.c_int64,
834
+ ctypes.POINTER(_UniffiRustCallStatus),
835
+ )
836
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_version.restype = _UniffiRustBuffer
837
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_version_json.argtypes = (
838
+ ctypes.c_void_p,
839
+ _UniffiRustBuffer,
840
+ ctypes.c_int64,
841
+ ctypes.POINTER(_UniffiRustCallStatus),
842
+ )
843
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_query_version_json.restype = _UniffiRustBuffer
844
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_vacuum.argtypes = (
845
+ ctypes.c_void_p,
846
+ ctypes.c_uint64,
847
+ ctypes.POINTER(_UniffiRustCallStatus),
848
+ )
849
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_vacuum.restype = None
850
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_vacuum_dry_run.argtypes = (
851
+ ctypes.c_void_p,
852
+ ctypes.c_uint64,
853
+ ctypes.POINTER(_UniffiRustCallStatus),
854
+ )
855
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_vacuum_dry_run.restype = _UniffiRustBuffer
856
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_zorder.argtypes = (
857
+ ctypes.c_void_p,
858
+ _UniffiRustBuffer,
859
+ ctypes.POINTER(_UniffiRustCallStatus),
860
+ )
861
+ _UniffiLib.uniffi_posixlake_fn_method_databaseops_zorder.restype = None
862
+ _UniffiLib.uniffi_posixlake_fn_clone_nfsserver.argtypes = (
863
+ ctypes.c_void_p,
864
+ ctypes.POINTER(_UniffiRustCallStatus),
865
+ )
866
+ _UniffiLib.uniffi_posixlake_fn_clone_nfsserver.restype = ctypes.c_void_p
867
+ _UniffiLib.uniffi_posixlake_fn_free_nfsserver.argtypes = (
868
+ ctypes.c_void_p,
869
+ ctypes.POINTER(_UniffiRustCallStatus),
870
+ )
871
+ _UniffiLib.uniffi_posixlake_fn_free_nfsserver.restype = None
872
+ _UniffiLib.uniffi_posixlake_fn_constructor_nfsserver_new.argtypes = (
873
+ ctypes.c_void_p,
874
+ ctypes.c_uint16,
875
+ ctypes.POINTER(_UniffiRustCallStatus),
876
+ )
877
+ _UniffiLib.uniffi_posixlake_fn_constructor_nfsserver_new.restype = ctypes.c_void_p
878
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_mount_command.argtypes = (
879
+ ctypes.c_void_p,
880
+ _UniffiRustBuffer,
881
+ ctypes.POINTER(_UniffiRustCallStatus),
882
+ )
883
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_mount_command.restype = _UniffiRustBuffer
884
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_port.argtypes = (
885
+ ctypes.c_void_p,
886
+ ctypes.POINTER(_UniffiRustCallStatus),
887
+ )
888
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_port.restype = ctypes.c_uint16
889
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_unmount_command.argtypes = (
890
+ ctypes.c_void_p,
891
+ _UniffiRustBuffer,
892
+ ctypes.POINTER(_UniffiRustCallStatus),
893
+ )
894
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_unmount_command.restype = _UniffiRustBuffer
895
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_is_ready.argtypes = (
896
+ ctypes.c_void_p,
897
+ ctypes.POINTER(_UniffiRustCallStatus),
898
+ )
899
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_is_ready.restype = ctypes.c_int8
900
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_shutdown.argtypes = (
901
+ ctypes.c_void_p,
902
+ ctypes.POINTER(_UniffiRustCallStatus),
903
+ )
904
+ _UniffiLib.uniffi_posixlake_fn_method_nfsserver_shutdown.restype = None
905
+ _UniffiLib.uniffi_posixlake_fn_func_restore.argtypes = (
906
+ _UniffiRustBuffer,
907
+ _UniffiRustBuffer,
908
+ ctypes.POINTER(_UniffiRustCallStatus),
909
+ )
910
+ _UniffiLib.uniffi_posixlake_fn_func_restore.restype = None
911
+ _UniffiLib.uniffi_posixlake_fn_func_restore_to_transaction.argtypes = (
912
+ _UniffiRustBuffer,
913
+ _UniffiRustBuffer,
914
+ ctypes.c_uint64,
915
+ ctypes.POINTER(_UniffiRustCallStatus),
916
+ )
917
+ _UniffiLib.uniffi_posixlake_fn_func_restore_to_transaction.restype = None
918
+ _UniffiLib.ffi_posixlake_rustbuffer_alloc.argtypes = (
919
+ ctypes.c_uint64,
920
+ ctypes.POINTER(_UniffiRustCallStatus),
921
+ )
922
+ _UniffiLib.ffi_posixlake_rustbuffer_alloc.restype = _UniffiRustBuffer
923
+ _UniffiLib.ffi_posixlake_rustbuffer_from_bytes.argtypes = (
924
+ _UniffiForeignBytes,
925
+ ctypes.POINTER(_UniffiRustCallStatus),
926
+ )
927
+ _UniffiLib.ffi_posixlake_rustbuffer_from_bytes.restype = _UniffiRustBuffer
928
+ _UniffiLib.ffi_posixlake_rustbuffer_free.argtypes = (
929
+ _UniffiRustBuffer,
930
+ ctypes.POINTER(_UniffiRustCallStatus),
931
+ )
932
+ _UniffiLib.ffi_posixlake_rustbuffer_free.restype = None
933
+ _UniffiLib.ffi_posixlake_rustbuffer_reserve.argtypes = (
934
+ _UniffiRustBuffer,
935
+ ctypes.c_uint64,
936
+ ctypes.POINTER(_UniffiRustCallStatus),
937
+ )
938
+ _UniffiLib.ffi_posixlake_rustbuffer_reserve.restype = _UniffiRustBuffer
939
+ _UniffiLib.ffi_posixlake_rust_future_poll_u8.argtypes = (
940
+ ctypes.c_uint64,
941
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
942
+ ctypes.c_uint64,
943
+ )
944
+ _UniffiLib.ffi_posixlake_rust_future_poll_u8.restype = None
945
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u8.argtypes = (
946
+ ctypes.c_uint64,
947
+ )
948
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u8.restype = None
949
+ _UniffiLib.ffi_posixlake_rust_future_free_u8.argtypes = (
950
+ ctypes.c_uint64,
951
+ )
952
+ _UniffiLib.ffi_posixlake_rust_future_free_u8.restype = None
953
+ _UniffiLib.ffi_posixlake_rust_future_complete_u8.argtypes = (
954
+ ctypes.c_uint64,
955
+ ctypes.POINTER(_UniffiRustCallStatus),
956
+ )
957
+ _UniffiLib.ffi_posixlake_rust_future_complete_u8.restype = ctypes.c_uint8
958
+ _UniffiLib.ffi_posixlake_rust_future_poll_i8.argtypes = (
959
+ ctypes.c_uint64,
960
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
961
+ ctypes.c_uint64,
962
+ )
963
+ _UniffiLib.ffi_posixlake_rust_future_poll_i8.restype = None
964
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i8.argtypes = (
965
+ ctypes.c_uint64,
966
+ )
967
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i8.restype = None
968
+ _UniffiLib.ffi_posixlake_rust_future_free_i8.argtypes = (
969
+ ctypes.c_uint64,
970
+ )
971
+ _UniffiLib.ffi_posixlake_rust_future_free_i8.restype = None
972
+ _UniffiLib.ffi_posixlake_rust_future_complete_i8.argtypes = (
973
+ ctypes.c_uint64,
974
+ ctypes.POINTER(_UniffiRustCallStatus),
975
+ )
976
+ _UniffiLib.ffi_posixlake_rust_future_complete_i8.restype = ctypes.c_int8
977
+ _UniffiLib.ffi_posixlake_rust_future_poll_u16.argtypes = (
978
+ ctypes.c_uint64,
979
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
980
+ ctypes.c_uint64,
981
+ )
982
+ _UniffiLib.ffi_posixlake_rust_future_poll_u16.restype = None
983
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u16.argtypes = (
984
+ ctypes.c_uint64,
985
+ )
986
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u16.restype = None
987
+ _UniffiLib.ffi_posixlake_rust_future_free_u16.argtypes = (
988
+ ctypes.c_uint64,
989
+ )
990
+ _UniffiLib.ffi_posixlake_rust_future_free_u16.restype = None
991
+ _UniffiLib.ffi_posixlake_rust_future_complete_u16.argtypes = (
992
+ ctypes.c_uint64,
993
+ ctypes.POINTER(_UniffiRustCallStatus),
994
+ )
995
+ _UniffiLib.ffi_posixlake_rust_future_complete_u16.restype = ctypes.c_uint16
996
+ _UniffiLib.ffi_posixlake_rust_future_poll_i16.argtypes = (
997
+ ctypes.c_uint64,
998
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
999
+ ctypes.c_uint64,
1000
+ )
1001
+ _UniffiLib.ffi_posixlake_rust_future_poll_i16.restype = None
1002
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i16.argtypes = (
1003
+ ctypes.c_uint64,
1004
+ )
1005
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i16.restype = None
1006
+ _UniffiLib.ffi_posixlake_rust_future_free_i16.argtypes = (
1007
+ ctypes.c_uint64,
1008
+ )
1009
+ _UniffiLib.ffi_posixlake_rust_future_free_i16.restype = None
1010
+ _UniffiLib.ffi_posixlake_rust_future_complete_i16.argtypes = (
1011
+ ctypes.c_uint64,
1012
+ ctypes.POINTER(_UniffiRustCallStatus),
1013
+ )
1014
+ _UniffiLib.ffi_posixlake_rust_future_complete_i16.restype = ctypes.c_int16
1015
+ _UniffiLib.ffi_posixlake_rust_future_poll_u32.argtypes = (
1016
+ ctypes.c_uint64,
1017
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1018
+ ctypes.c_uint64,
1019
+ )
1020
+ _UniffiLib.ffi_posixlake_rust_future_poll_u32.restype = None
1021
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u32.argtypes = (
1022
+ ctypes.c_uint64,
1023
+ )
1024
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u32.restype = None
1025
+ _UniffiLib.ffi_posixlake_rust_future_free_u32.argtypes = (
1026
+ ctypes.c_uint64,
1027
+ )
1028
+ _UniffiLib.ffi_posixlake_rust_future_free_u32.restype = None
1029
+ _UniffiLib.ffi_posixlake_rust_future_complete_u32.argtypes = (
1030
+ ctypes.c_uint64,
1031
+ ctypes.POINTER(_UniffiRustCallStatus),
1032
+ )
1033
+ _UniffiLib.ffi_posixlake_rust_future_complete_u32.restype = ctypes.c_uint32
1034
+ _UniffiLib.ffi_posixlake_rust_future_poll_i32.argtypes = (
1035
+ ctypes.c_uint64,
1036
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1037
+ ctypes.c_uint64,
1038
+ )
1039
+ _UniffiLib.ffi_posixlake_rust_future_poll_i32.restype = None
1040
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i32.argtypes = (
1041
+ ctypes.c_uint64,
1042
+ )
1043
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i32.restype = None
1044
+ _UniffiLib.ffi_posixlake_rust_future_free_i32.argtypes = (
1045
+ ctypes.c_uint64,
1046
+ )
1047
+ _UniffiLib.ffi_posixlake_rust_future_free_i32.restype = None
1048
+ _UniffiLib.ffi_posixlake_rust_future_complete_i32.argtypes = (
1049
+ ctypes.c_uint64,
1050
+ ctypes.POINTER(_UniffiRustCallStatus),
1051
+ )
1052
+ _UniffiLib.ffi_posixlake_rust_future_complete_i32.restype = ctypes.c_int32
1053
+ _UniffiLib.ffi_posixlake_rust_future_poll_u64.argtypes = (
1054
+ ctypes.c_uint64,
1055
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1056
+ ctypes.c_uint64,
1057
+ )
1058
+ _UniffiLib.ffi_posixlake_rust_future_poll_u64.restype = None
1059
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u64.argtypes = (
1060
+ ctypes.c_uint64,
1061
+ )
1062
+ _UniffiLib.ffi_posixlake_rust_future_cancel_u64.restype = None
1063
+ _UniffiLib.ffi_posixlake_rust_future_free_u64.argtypes = (
1064
+ ctypes.c_uint64,
1065
+ )
1066
+ _UniffiLib.ffi_posixlake_rust_future_free_u64.restype = None
1067
+ _UniffiLib.ffi_posixlake_rust_future_complete_u64.argtypes = (
1068
+ ctypes.c_uint64,
1069
+ ctypes.POINTER(_UniffiRustCallStatus),
1070
+ )
1071
+ _UniffiLib.ffi_posixlake_rust_future_complete_u64.restype = ctypes.c_uint64
1072
+ _UniffiLib.ffi_posixlake_rust_future_poll_i64.argtypes = (
1073
+ ctypes.c_uint64,
1074
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1075
+ ctypes.c_uint64,
1076
+ )
1077
+ _UniffiLib.ffi_posixlake_rust_future_poll_i64.restype = None
1078
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i64.argtypes = (
1079
+ ctypes.c_uint64,
1080
+ )
1081
+ _UniffiLib.ffi_posixlake_rust_future_cancel_i64.restype = None
1082
+ _UniffiLib.ffi_posixlake_rust_future_free_i64.argtypes = (
1083
+ ctypes.c_uint64,
1084
+ )
1085
+ _UniffiLib.ffi_posixlake_rust_future_free_i64.restype = None
1086
+ _UniffiLib.ffi_posixlake_rust_future_complete_i64.argtypes = (
1087
+ ctypes.c_uint64,
1088
+ ctypes.POINTER(_UniffiRustCallStatus),
1089
+ )
1090
+ _UniffiLib.ffi_posixlake_rust_future_complete_i64.restype = ctypes.c_int64
1091
+ _UniffiLib.ffi_posixlake_rust_future_poll_f32.argtypes = (
1092
+ ctypes.c_uint64,
1093
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1094
+ ctypes.c_uint64,
1095
+ )
1096
+ _UniffiLib.ffi_posixlake_rust_future_poll_f32.restype = None
1097
+ _UniffiLib.ffi_posixlake_rust_future_cancel_f32.argtypes = (
1098
+ ctypes.c_uint64,
1099
+ )
1100
+ _UniffiLib.ffi_posixlake_rust_future_cancel_f32.restype = None
1101
+ _UniffiLib.ffi_posixlake_rust_future_free_f32.argtypes = (
1102
+ ctypes.c_uint64,
1103
+ )
1104
+ _UniffiLib.ffi_posixlake_rust_future_free_f32.restype = None
1105
+ _UniffiLib.ffi_posixlake_rust_future_complete_f32.argtypes = (
1106
+ ctypes.c_uint64,
1107
+ ctypes.POINTER(_UniffiRustCallStatus),
1108
+ )
1109
+ _UniffiLib.ffi_posixlake_rust_future_complete_f32.restype = ctypes.c_float
1110
+ _UniffiLib.ffi_posixlake_rust_future_poll_f64.argtypes = (
1111
+ ctypes.c_uint64,
1112
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1113
+ ctypes.c_uint64,
1114
+ )
1115
+ _UniffiLib.ffi_posixlake_rust_future_poll_f64.restype = None
1116
+ _UniffiLib.ffi_posixlake_rust_future_cancel_f64.argtypes = (
1117
+ ctypes.c_uint64,
1118
+ )
1119
+ _UniffiLib.ffi_posixlake_rust_future_cancel_f64.restype = None
1120
+ _UniffiLib.ffi_posixlake_rust_future_free_f64.argtypes = (
1121
+ ctypes.c_uint64,
1122
+ )
1123
+ _UniffiLib.ffi_posixlake_rust_future_free_f64.restype = None
1124
+ _UniffiLib.ffi_posixlake_rust_future_complete_f64.argtypes = (
1125
+ ctypes.c_uint64,
1126
+ ctypes.POINTER(_UniffiRustCallStatus),
1127
+ )
1128
+ _UniffiLib.ffi_posixlake_rust_future_complete_f64.restype = ctypes.c_double
1129
+ _UniffiLib.ffi_posixlake_rust_future_poll_pointer.argtypes = (
1130
+ ctypes.c_uint64,
1131
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1132
+ ctypes.c_uint64,
1133
+ )
1134
+ _UniffiLib.ffi_posixlake_rust_future_poll_pointer.restype = None
1135
+ _UniffiLib.ffi_posixlake_rust_future_cancel_pointer.argtypes = (
1136
+ ctypes.c_uint64,
1137
+ )
1138
+ _UniffiLib.ffi_posixlake_rust_future_cancel_pointer.restype = None
1139
+ _UniffiLib.ffi_posixlake_rust_future_free_pointer.argtypes = (
1140
+ ctypes.c_uint64,
1141
+ )
1142
+ _UniffiLib.ffi_posixlake_rust_future_free_pointer.restype = None
1143
+ _UniffiLib.ffi_posixlake_rust_future_complete_pointer.argtypes = (
1144
+ ctypes.c_uint64,
1145
+ ctypes.POINTER(_UniffiRustCallStatus),
1146
+ )
1147
+ _UniffiLib.ffi_posixlake_rust_future_complete_pointer.restype = ctypes.c_void_p
1148
+ _UniffiLib.ffi_posixlake_rust_future_poll_rust_buffer.argtypes = (
1149
+ ctypes.c_uint64,
1150
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1151
+ ctypes.c_uint64,
1152
+ )
1153
+ _UniffiLib.ffi_posixlake_rust_future_poll_rust_buffer.restype = None
1154
+ _UniffiLib.ffi_posixlake_rust_future_cancel_rust_buffer.argtypes = (
1155
+ ctypes.c_uint64,
1156
+ )
1157
+ _UniffiLib.ffi_posixlake_rust_future_cancel_rust_buffer.restype = None
1158
+ _UniffiLib.ffi_posixlake_rust_future_free_rust_buffer.argtypes = (
1159
+ ctypes.c_uint64,
1160
+ )
1161
+ _UniffiLib.ffi_posixlake_rust_future_free_rust_buffer.restype = None
1162
+ _UniffiLib.ffi_posixlake_rust_future_complete_rust_buffer.argtypes = (
1163
+ ctypes.c_uint64,
1164
+ ctypes.POINTER(_UniffiRustCallStatus),
1165
+ )
1166
+ _UniffiLib.ffi_posixlake_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer
1167
+ _UniffiLib.ffi_posixlake_rust_future_poll_void.argtypes = (
1168
+ ctypes.c_uint64,
1169
+ _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
1170
+ ctypes.c_uint64,
1171
+ )
1172
+ _UniffiLib.ffi_posixlake_rust_future_poll_void.restype = None
1173
+ _UniffiLib.ffi_posixlake_rust_future_cancel_void.argtypes = (
1174
+ ctypes.c_uint64,
1175
+ )
1176
+ _UniffiLib.ffi_posixlake_rust_future_cancel_void.restype = None
1177
+ _UniffiLib.ffi_posixlake_rust_future_free_void.argtypes = (
1178
+ ctypes.c_uint64,
1179
+ )
1180
+ _UniffiLib.ffi_posixlake_rust_future_free_void.restype = None
1181
+ _UniffiLib.ffi_posixlake_rust_future_complete_void.argtypes = (
1182
+ ctypes.c_uint64,
1183
+ ctypes.POINTER(_UniffiRustCallStatus),
1184
+ )
1185
+ _UniffiLib.ffi_posixlake_rust_future_complete_void.restype = None
1186
+ _UniffiLib.uniffi_posixlake_checksum_func_restore.argtypes = (
1187
+ )
1188
+ _UniffiLib.uniffi_posixlake_checksum_func_restore.restype = ctypes.c_uint16
1189
+ _UniffiLib.uniffi_posixlake_checksum_func_restore_to_transaction.argtypes = (
1190
+ )
1191
+ _UniffiLib.uniffi_posixlake_checksum_func_restore_to_transaction.restype = ctypes.c_uint16
1192
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_backup.argtypes = (
1193
+ )
1194
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_backup.restype = ctypes.c_uint16
1195
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_backup_incremental.argtypes = (
1196
+ )
1197
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_backup_incremental.restype = ctypes.c_uint16
1198
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_create_user.argtypes = (
1199
+ )
1200
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_create_user.restype = ctypes.c_uint16
1201
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_delete_rows_where.argtypes = (
1202
+ )
1203
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_delete_rows_where.restype = ctypes.c_uint16
1204
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_flush_write_buffer.argtypes = (
1205
+ )
1206
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_flush_write_buffer.restype = ctypes.c_uint16
1207
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_base_path.argtypes = (
1208
+ )
1209
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_base_path.restype = ctypes.c_uint16
1210
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_data_skipping_stats.argtypes = (
1211
+ )
1212
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_data_skipping_stats.restype = ctypes.c_uint16
1213
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_metrics.argtypes = (
1214
+ )
1215
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_metrics.restype = ctypes.c_uint16
1216
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_schema.argtypes = (
1217
+ )
1218
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_get_schema.restype = ctypes.c_uint16
1219
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_health_check.argtypes = (
1220
+ )
1221
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_health_check.restype = ctypes.c_uint16
1222
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_insert_buffered_json.argtypes = (
1223
+ )
1224
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_insert_buffered_json.restype = ctypes.c_uint16
1225
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_insert_json.argtypes = (
1226
+ )
1227
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_insert_json.restype = ctypes.c_uint16
1228
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_merge_json.argtypes = (
1229
+ )
1230
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_merge_json.restype = ctypes.c_uint16
1231
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_optimize.argtypes = (
1232
+ )
1233
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_optimize.restype = ctypes.c_uint16
1234
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_optimize_with_filter.argtypes = (
1235
+ )
1236
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_optimize_with_filter.restype = ctypes.c_uint16
1237
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_optimize_with_target_size.argtypes = (
1238
+ )
1239
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_optimize_with_target_size.restype = ctypes.c_uint16
1240
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query.argtypes = (
1241
+ )
1242
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query.restype = ctypes.c_uint16
1243
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_json.argtypes = (
1244
+ )
1245
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_json.restype = ctypes.c_uint16
1246
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_timestamp.argtypes = (
1247
+ )
1248
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_timestamp.restype = ctypes.c_uint16
1249
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_timestamp_json.argtypes = (
1250
+ )
1251
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_timestamp_json.restype = ctypes.c_uint16
1252
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_version.argtypes = (
1253
+ )
1254
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_version.restype = ctypes.c_uint16
1255
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_version_json.argtypes = (
1256
+ )
1257
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_query_version_json.restype = ctypes.c_uint16
1258
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_vacuum.argtypes = (
1259
+ )
1260
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_vacuum.restype = ctypes.c_uint16
1261
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_vacuum_dry_run.argtypes = (
1262
+ )
1263
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_vacuum_dry_run.restype = ctypes.c_uint16
1264
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_zorder.argtypes = (
1265
+ )
1266
+ _UniffiLib.uniffi_posixlake_checksum_method_databaseops_zorder.restype = ctypes.c_uint16
1267
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_get_mount_command.argtypes = (
1268
+ )
1269
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_get_mount_command.restype = ctypes.c_uint16
1270
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_get_port.argtypes = (
1271
+ )
1272
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_get_port.restype = ctypes.c_uint16
1273
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_get_unmount_command.argtypes = (
1274
+ )
1275
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_get_unmount_command.restype = ctypes.c_uint16
1276
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_is_ready.argtypes = (
1277
+ )
1278
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_is_ready.restype = ctypes.c_uint16
1279
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_shutdown.argtypes = (
1280
+ )
1281
+ _UniffiLib.uniffi_posixlake_checksum_method_nfsserver_shutdown.restype = ctypes.c_uint16
1282
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create.argtypes = (
1283
+ )
1284
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create.restype = ctypes.c_uint16
1285
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_from_csv.argtypes = (
1286
+ )
1287
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_from_csv.restype = ctypes.c_uint16
1288
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_from_parquet.argtypes = (
1289
+ )
1290
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_from_parquet.restype = ctypes.c_uint16
1291
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_with_auth.argtypes = (
1292
+ )
1293
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_with_auth.restype = ctypes.c_uint16
1294
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_with_s3.argtypes = (
1295
+ )
1296
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_create_with_s3.restype = ctypes.c_uint16
1297
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_open.argtypes = (
1298
+ )
1299
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_open.restype = ctypes.c_uint16
1300
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_open_with_credentials.argtypes = (
1301
+ )
1302
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_open_with_credentials.restype = ctypes.c_uint16
1303
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_open_with_s3.argtypes = (
1304
+ )
1305
+ _UniffiLib.uniffi_posixlake_checksum_constructor_databaseops_open_with_s3.restype = ctypes.c_uint16
1306
+ _UniffiLib.uniffi_posixlake_checksum_constructor_nfsserver_new.argtypes = (
1307
+ )
1308
+ _UniffiLib.uniffi_posixlake_checksum_constructor_nfsserver_new.restype = ctypes.c_uint16
1309
+ _UniffiLib.ffi_posixlake_uniffi_contract_version.argtypes = (
1310
+ )
1311
+ _UniffiLib.ffi_posixlake_uniffi_contract_version.restype = ctypes.c_uint32
1312
+
1313
+ _uniffi_check_contract_api_version(_UniffiLib)
1314
+ # _uniffi_check_api_checksums(_UniffiLib)
1315
+
1316
+ # Public interface members begin here.
1317
+
1318
+
1319
+ class _UniffiConverterUInt16(_UniffiConverterPrimitiveInt):
1320
+ CLASS_NAME = "u16"
1321
+ VALUE_MIN = 0
1322
+ VALUE_MAX = 2**16
1323
+
1324
+ @staticmethod
1325
+ def read(buf):
1326
+ return buf.read_u16()
1327
+
1328
+ @staticmethod
1329
+ def write(value, buf):
1330
+ buf.write_u16(value)
1331
+
1332
+ class _UniffiConverterUInt64(_UniffiConverterPrimitiveInt):
1333
+ CLASS_NAME = "u64"
1334
+ VALUE_MIN = 0
1335
+ VALUE_MAX = 2**64
1336
+
1337
+ @staticmethod
1338
+ def read(buf):
1339
+ return buf.read_u64()
1340
+
1341
+ @staticmethod
1342
+ def write(value, buf):
1343
+ buf.write_u64(value)
1344
+
1345
+ class _UniffiConverterInt64(_UniffiConverterPrimitiveInt):
1346
+ CLASS_NAME = "i64"
1347
+ VALUE_MIN = -2**63
1348
+ VALUE_MAX = 2**63
1349
+
1350
+ @staticmethod
1351
+ def read(buf):
1352
+ return buf.read_i64()
1353
+
1354
+ @staticmethod
1355
+ def write(value, buf):
1356
+ buf.write_i64(value)
1357
+
1358
+ class _UniffiConverterDouble(_UniffiConverterPrimitiveFloat):
1359
+ @staticmethod
1360
+ def read(buf):
1361
+ return buf.read_double()
1362
+
1363
+ @staticmethod
1364
+ def write(value, buf):
1365
+ buf.write_double(value)
1366
+
1367
+ class _UniffiConverterBool:
1368
+ @classmethod
1369
+ def check_lower(cls, value):
1370
+ return not not value
1371
+
1372
+ @classmethod
1373
+ def lower(cls, value):
1374
+ return 1 if value else 0
1375
+
1376
+ @staticmethod
1377
+ def lift(value):
1378
+ return value != 0
1379
+
1380
+ @classmethod
1381
+ def read(cls, buf):
1382
+ return cls.lift(buf.read_u8())
1383
+
1384
+ @classmethod
1385
+ def write(cls, value, buf):
1386
+ buf.write_u8(value)
1387
+
1388
+ class _UniffiConverterString:
1389
+ @staticmethod
1390
+ def check_lower(value):
1391
+ if not isinstance(value, str):
1392
+ raise TypeError("argument must be str, not {}".format(type(value).__name__))
1393
+ return value
1394
+
1395
+ @staticmethod
1396
+ def read(buf):
1397
+ size = buf.read_i32()
1398
+ if size < 0:
1399
+ raise InternalError("Unexpected negative string length")
1400
+ utf8_bytes = buf.read(size)
1401
+ return utf8_bytes.decode("utf-8")
1402
+
1403
+ @staticmethod
1404
+ def write(value, buf):
1405
+ utf8_bytes = value.encode("utf-8")
1406
+ buf.write_i32(len(utf8_bytes))
1407
+ buf.write(utf8_bytes)
1408
+
1409
+ @staticmethod
1410
+ def lift(buf):
1411
+ with buf.consume_with_stream() as stream:
1412
+ return stream.read(stream.remaining()).decode("utf-8")
1413
+
1414
+ @staticmethod
1415
+ def lower(value):
1416
+ with _UniffiRustBuffer.alloc_with_builder() as builder:
1417
+ builder.write(value.encode("utf-8"))
1418
+ return builder.finalize()
1419
+
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+ class DataSkippingStats:
1426
+ """
1427
+ Data skipping statistics
1428
+ """
1429
+
1430
+ total_files: "int"
1431
+ files_read: "int"
1432
+ files_skipped: "int"
1433
+ bytes_scanned: "int"
1434
+ bytes_skipped: "int"
1435
+ def __init__(self, *, total_files: "int", files_read: "int", files_skipped: "int", bytes_scanned: "int", bytes_skipped: "int"):
1436
+ self.total_files = total_files
1437
+ self.files_read = files_read
1438
+ self.files_skipped = files_skipped
1439
+ self.bytes_scanned = bytes_scanned
1440
+ self.bytes_skipped = bytes_skipped
1441
+
1442
+ def __str__(self):
1443
+ return "DataSkippingStats(total_files={}, files_read={}, files_skipped={}, bytes_scanned={}, bytes_skipped={})".format(self.total_files, self.files_read, self.files_skipped, self.bytes_scanned, self.bytes_skipped)
1444
+
1445
+ def __eq__(self, other):
1446
+ if self.total_files != other.total_files:
1447
+ return False
1448
+ if self.files_read != other.files_read:
1449
+ return False
1450
+ if self.files_skipped != other.files_skipped:
1451
+ return False
1452
+ if self.bytes_scanned != other.bytes_scanned:
1453
+ return False
1454
+ if self.bytes_skipped != other.bytes_skipped:
1455
+ return False
1456
+ return True
1457
+
1458
+ class _UniffiConverterTypeDataSkippingStats(_UniffiConverterRustBuffer):
1459
+ @staticmethod
1460
+ def read(buf):
1461
+ return DataSkippingStats(
1462
+ total_files=_UniffiConverterUInt64.read(buf),
1463
+ files_read=_UniffiConverterUInt64.read(buf),
1464
+ files_skipped=_UniffiConverterUInt64.read(buf),
1465
+ bytes_scanned=_UniffiConverterUInt64.read(buf),
1466
+ bytes_skipped=_UniffiConverterUInt64.read(buf),
1467
+ )
1468
+
1469
+ @staticmethod
1470
+ def check_lower(value):
1471
+ _UniffiConverterUInt64.check_lower(value.total_files)
1472
+ _UniffiConverterUInt64.check_lower(value.files_read)
1473
+ _UniffiConverterUInt64.check_lower(value.files_skipped)
1474
+ _UniffiConverterUInt64.check_lower(value.bytes_scanned)
1475
+ _UniffiConverterUInt64.check_lower(value.bytes_skipped)
1476
+
1477
+ @staticmethod
1478
+ def write(value, buf):
1479
+ _UniffiConverterUInt64.write(value.total_files, buf)
1480
+ _UniffiConverterUInt64.write(value.files_read, buf)
1481
+ _UniffiConverterUInt64.write(value.files_skipped, buf)
1482
+ _UniffiConverterUInt64.write(value.bytes_scanned, buf)
1483
+ _UniffiConverterUInt64.write(value.bytes_skipped, buf)
1484
+
1485
+
1486
+ class DatabaseMetrics:
1487
+ """
1488
+ Database metrics for monitoring
1489
+ """
1490
+
1491
+ total_queries: "int"
1492
+ total_inserts: "int"
1493
+ total_deletes: "int"
1494
+ total_transactions: "int"
1495
+ total_errors: "int"
1496
+ avg_query_latency_ms: "float"
1497
+ max_query_latency_ms: "float"
1498
+ uptime_seconds: "float"
1499
+ def __init__(self, *, total_queries: "int", total_inserts: "int", total_deletes: "int", total_transactions: "int", total_errors: "int", avg_query_latency_ms: "float", max_query_latency_ms: "float", uptime_seconds: "float"):
1500
+ self.total_queries = total_queries
1501
+ self.total_inserts = total_inserts
1502
+ self.total_deletes = total_deletes
1503
+ self.total_transactions = total_transactions
1504
+ self.total_errors = total_errors
1505
+ self.avg_query_latency_ms = avg_query_latency_ms
1506
+ self.max_query_latency_ms = max_query_latency_ms
1507
+ self.uptime_seconds = uptime_seconds
1508
+
1509
+ def __str__(self):
1510
+ return "DatabaseMetrics(total_queries={}, total_inserts={}, total_deletes={}, total_transactions={}, total_errors={}, avg_query_latency_ms={}, max_query_latency_ms={}, uptime_seconds={})".format(self.total_queries, self.total_inserts, self.total_deletes, self.total_transactions, self.total_errors, self.avg_query_latency_ms, self.max_query_latency_ms, self.uptime_seconds)
1511
+
1512
+ def __eq__(self, other):
1513
+ if self.total_queries != other.total_queries:
1514
+ return False
1515
+ if self.total_inserts != other.total_inserts:
1516
+ return False
1517
+ if self.total_deletes != other.total_deletes:
1518
+ return False
1519
+ if self.total_transactions != other.total_transactions:
1520
+ return False
1521
+ if self.total_errors != other.total_errors:
1522
+ return False
1523
+ if self.avg_query_latency_ms != other.avg_query_latency_ms:
1524
+ return False
1525
+ if self.max_query_latency_ms != other.max_query_latency_ms:
1526
+ return False
1527
+ if self.uptime_seconds != other.uptime_seconds:
1528
+ return False
1529
+ return True
1530
+
1531
+ class _UniffiConverterTypeDatabaseMetrics(_UniffiConverterRustBuffer):
1532
+ @staticmethod
1533
+ def read(buf):
1534
+ return DatabaseMetrics(
1535
+ total_queries=_UniffiConverterUInt64.read(buf),
1536
+ total_inserts=_UniffiConverterUInt64.read(buf),
1537
+ total_deletes=_UniffiConverterUInt64.read(buf),
1538
+ total_transactions=_UniffiConverterUInt64.read(buf),
1539
+ total_errors=_UniffiConverterUInt64.read(buf),
1540
+ avg_query_latency_ms=_UniffiConverterDouble.read(buf),
1541
+ max_query_latency_ms=_UniffiConverterDouble.read(buf),
1542
+ uptime_seconds=_UniffiConverterDouble.read(buf),
1543
+ )
1544
+
1545
+ @staticmethod
1546
+ def check_lower(value):
1547
+ _UniffiConverterUInt64.check_lower(value.total_queries)
1548
+ _UniffiConverterUInt64.check_lower(value.total_inserts)
1549
+ _UniffiConverterUInt64.check_lower(value.total_deletes)
1550
+ _UniffiConverterUInt64.check_lower(value.total_transactions)
1551
+ _UniffiConverterUInt64.check_lower(value.total_errors)
1552
+ _UniffiConverterDouble.check_lower(value.avg_query_latency_ms)
1553
+ _UniffiConverterDouble.check_lower(value.max_query_latency_ms)
1554
+ _UniffiConverterDouble.check_lower(value.uptime_seconds)
1555
+
1556
+ @staticmethod
1557
+ def write(value, buf):
1558
+ _UniffiConverterUInt64.write(value.total_queries, buf)
1559
+ _UniffiConverterUInt64.write(value.total_inserts, buf)
1560
+ _UniffiConverterUInt64.write(value.total_deletes, buf)
1561
+ _UniffiConverterUInt64.write(value.total_transactions, buf)
1562
+ _UniffiConverterUInt64.write(value.total_errors, buf)
1563
+ _UniffiConverterDouble.write(value.avg_query_latency_ms, buf)
1564
+ _UniffiConverterDouble.write(value.max_query_latency_ms, buf)
1565
+ _UniffiConverterDouble.write(value.uptime_seconds, buf)
1566
+
1567
+
1568
+ class Field:
1569
+ """
1570
+ Schema field definition
1571
+ """
1572
+
1573
+ name: "str"
1574
+ data_type: "str"
1575
+ nullable: "bool"
1576
+ def __init__(self, *, name: "str", data_type: "str", nullable: "bool"):
1577
+ self.name = name
1578
+ self.data_type = data_type
1579
+ self.nullable = nullable
1580
+
1581
+ def __str__(self):
1582
+ return "Field(name={}, data_type={}, nullable={})".format(self.name, self.data_type, self.nullable)
1583
+
1584
+ def __eq__(self, other):
1585
+ if self.name != other.name:
1586
+ return False
1587
+ if self.data_type != other.data_type:
1588
+ return False
1589
+ if self.nullable != other.nullable:
1590
+ return False
1591
+ return True
1592
+
1593
+ class _UniffiConverterTypeField(_UniffiConverterRustBuffer):
1594
+ @staticmethod
1595
+ def read(buf):
1596
+ return Field(
1597
+ name=_UniffiConverterString.read(buf),
1598
+ data_type=_UniffiConverterString.read(buf),
1599
+ nullable=_UniffiConverterBool.read(buf),
1600
+ )
1601
+
1602
+ @staticmethod
1603
+ def check_lower(value):
1604
+ _UniffiConverterString.check_lower(value.name)
1605
+ _UniffiConverterString.check_lower(value.data_type)
1606
+ _UniffiConverterBool.check_lower(value.nullable)
1607
+
1608
+ @staticmethod
1609
+ def write(value, buf):
1610
+ _UniffiConverterString.write(value.name, buf)
1611
+ _UniffiConverterString.write(value.data_type, buf)
1612
+ _UniffiConverterBool.write(value.nullable, buf)
1613
+
1614
+
1615
+ class HealthStatus:
1616
+ """
1617
+ Health status
1618
+ """
1619
+
1620
+ status: "str"
1621
+ uptime_seconds: "float"
1622
+ total_files: "int"
1623
+ total_rows: "int"
1624
+ total_size_bytes: "int"
1625
+ def __init__(self, *, status: "str", uptime_seconds: "float", total_files: "int", total_rows: "int", total_size_bytes: "int"):
1626
+ self.status = status
1627
+ self.uptime_seconds = uptime_seconds
1628
+ self.total_files = total_files
1629
+ self.total_rows = total_rows
1630
+ self.total_size_bytes = total_size_bytes
1631
+
1632
+ def __str__(self):
1633
+ return "HealthStatus(status={}, uptime_seconds={}, total_files={}, total_rows={}, total_size_bytes={})".format(self.status, self.uptime_seconds, self.total_files, self.total_rows, self.total_size_bytes)
1634
+
1635
+ def __eq__(self, other):
1636
+ if self.status != other.status:
1637
+ return False
1638
+ if self.uptime_seconds != other.uptime_seconds:
1639
+ return False
1640
+ if self.total_files != other.total_files:
1641
+ return False
1642
+ if self.total_rows != other.total_rows:
1643
+ return False
1644
+ if self.total_size_bytes != other.total_size_bytes:
1645
+ return False
1646
+ return True
1647
+
1648
+ class _UniffiConverterTypeHealthStatus(_UniffiConverterRustBuffer):
1649
+ @staticmethod
1650
+ def read(buf):
1651
+ return HealthStatus(
1652
+ status=_UniffiConverterString.read(buf),
1653
+ uptime_seconds=_UniffiConverterDouble.read(buf),
1654
+ total_files=_UniffiConverterUInt64.read(buf),
1655
+ total_rows=_UniffiConverterUInt64.read(buf),
1656
+ total_size_bytes=_UniffiConverterUInt64.read(buf),
1657
+ )
1658
+
1659
+ @staticmethod
1660
+ def check_lower(value):
1661
+ _UniffiConverterString.check_lower(value.status)
1662
+ _UniffiConverterDouble.check_lower(value.uptime_seconds)
1663
+ _UniffiConverterUInt64.check_lower(value.total_files)
1664
+ _UniffiConverterUInt64.check_lower(value.total_rows)
1665
+ _UniffiConverterUInt64.check_lower(value.total_size_bytes)
1666
+
1667
+ @staticmethod
1668
+ def write(value, buf):
1669
+ _UniffiConverterString.write(value.status, buf)
1670
+ _UniffiConverterDouble.write(value.uptime_seconds, buf)
1671
+ _UniffiConverterUInt64.write(value.total_files, buf)
1672
+ _UniffiConverterUInt64.write(value.total_rows, buf)
1673
+ _UniffiConverterUInt64.write(value.total_size_bytes, buf)
1674
+
1675
+
1676
+ class Row:
1677
+ """
1678
+ Query result row
1679
+ """
1680
+
1681
+ values: "dict[str, str]"
1682
+ def __init__(self, *, values: "dict[str, str]"):
1683
+ self.values = values
1684
+
1685
+ def __str__(self):
1686
+ return "Row(values={})".format(self.values)
1687
+
1688
+ def __eq__(self, other):
1689
+ if self.values != other.values:
1690
+ return False
1691
+ return True
1692
+
1693
+ class _UniffiConverterTypeRow(_UniffiConverterRustBuffer):
1694
+ @staticmethod
1695
+ def read(buf):
1696
+ return Row(
1697
+ values=_UniffiConverterMapStringString.read(buf),
1698
+ )
1699
+
1700
+ @staticmethod
1701
+ def check_lower(value):
1702
+ _UniffiConverterMapStringString.check_lower(value.values)
1703
+
1704
+ @staticmethod
1705
+ def write(value, buf):
1706
+ _UniffiConverterMapStringString.write(value.values, buf)
1707
+
1708
+
1709
+ class S3Config:
1710
+ """
1711
+ S3 configuration
1712
+ """
1713
+
1714
+ endpoint: "str"
1715
+ access_key_id: "str"
1716
+ secret_access_key: "str"
1717
+ region: "str"
1718
+ def __init__(self, *, endpoint: "str", access_key_id: "str", secret_access_key: "str", region: "str"):
1719
+ self.endpoint = endpoint
1720
+ self.access_key_id = access_key_id
1721
+ self.secret_access_key = secret_access_key
1722
+ self.region = region
1723
+
1724
+ def __str__(self):
1725
+ return "S3Config(endpoint={}, access_key_id={}, secret_access_key={}, region={})".format(self.endpoint, self.access_key_id, self.secret_access_key, self.region)
1726
+
1727
+ def __eq__(self, other):
1728
+ if self.endpoint != other.endpoint:
1729
+ return False
1730
+ if self.access_key_id != other.access_key_id:
1731
+ return False
1732
+ if self.secret_access_key != other.secret_access_key:
1733
+ return False
1734
+ if self.region != other.region:
1735
+ return False
1736
+ return True
1737
+
1738
+ class _UniffiConverterTypeS3Config(_UniffiConverterRustBuffer):
1739
+ @staticmethod
1740
+ def read(buf):
1741
+ return S3Config(
1742
+ endpoint=_UniffiConverterString.read(buf),
1743
+ access_key_id=_UniffiConverterString.read(buf),
1744
+ secret_access_key=_UniffiConverterString.read(buf),
1745
+ region=_UniffiConverterString.read(buf),
1746
+ )
1747
+
1748
+ @staticmethod
1749
+ def check_lower(value):
1750
+ _UniffiConverterString.check_lower(value.endpoint)
1751
+ _UniffiConverterString.check_lower(value.access_key_id)
1752
+ _UniffiConverterString.check_lower(value.secret_access_key)
1753
+ _UniffiConverterString.check_lower(value.region)
1754
+
1755
+ @staticmethod
1756
+ def write(value, buf):
1757
+ _UniffiConverterString.write(value.endpoint, buf)
1758
+ _UniffiConverterString.write(value.access_key_id, buf)
1759
+ _UniffiConverterString.write(value.secret_access_key, buf)
1760
+ _UniffiConverterString.write(value.region, buf)
1761
+
1762
+
1763
+ class Schema:
1764
+ """
1765
+ Database schema
1766
+ """
1767
+
1768
+ fields: "typing.List[Field]"
1769
+ def __init__(self, *, fields: "typing.List[Field]"):
1770
+ self.fields = fields
1771
+
1772
+ def __str__(self):
1773
+ return "Schema(fields={})".format(self.fields)
1774
+
1775
+ def __eq__(self, other):
1776
+ if self.fields != other.fields:
1777
+ return False
1778
+ return True
1779
+
1780
+ class _UniffiConverterTypeSchema(_UniffiConverterRustBuffer):
1781
+ @staticmethod
1782
+ def read(buf):
1783
+ return Schema(
1784
+ fields=_UniffiConverterSequenceTypeField.read(buf),
1785
+ )
1786
+
1787
+ @staticmethod
1788
+ def check_lower(value):
1789
+ _UniffiConverterSequenceTypeField.check_lower(value.fields)
1790
+
1791
+ @staticmethod
1792
+ def write(value, buf):
1793
+ _UniffiConverterSequenceTypeField.write(value.fields, buf)
1794
+
1795
+
1796
+ # PosixLakeError
1797
+ # We want to define each variant as a nested class that's also a subclass,
1798
+ # which is tricky in Python. To accomplish this we're going to create each
1799
+ # class separately, then manually add the child classes to the base class's
1800
+ # __dict__. All of this happens in dummy class to avoid polluting the module
1801
+ # namespace.
1802
+ class PosixLakeError(Exception):
1803
+ """
1804
+ Error types for posixlake Python bindings
1805
+ """
1806
+
1807
+ pass
1808
+
1809
+ _UniffiTempPosixLakeError = PosixLakeError
1810
+
1811
+ class PosixLakeError: # type: ignore
1812
+ """
1813
+ Error types for posixlake Python bindings
1814
+ """
1815
+
1816
+ class IoError(_UniffiTempPosixLakeError):
1817
+ def __init__(self, message):
1818
+ super().__init__(", ".join([
1819
+ "message={!r}".format(message),
1820
+ ]))
1821
+ self.message = message
1822
+
1823
+ def __repr__(self):
1824
+ return "PosixLakeError.IoError({})".format(str(self))
1825
+ _UniffiTempPosixLakeError.IoError = IoError # type: ignore
1826
+ class SerializationError(_UniffiTempPosixLakeError):
1827
+ def __init__(self, message):
1828
+ super().__init__(", ".join([
1829
+ "message={!r}".format(message),
1830
+ ]))
1831
+ self.message = message
1832
+
1833
+ def __repr__(self):
1834
+ return "PosixLakeError.SerializationError({})".format(str(self))
1835
+ _UniffiTempPosixLakeError.SerializationError = SerializationError # type: ignore
1836
+ class ObjectStoreError(_UniffiTempPosixLakeError):
1837
+ def __init__(self, message):
1838
+ super().__init__(", ".join([
1839
+ "message={!r}".format(message),
1840
+ ]))
1841
+ self.message = message
1842
+
1843
+ def __repr__(self):
1844
+ return "PosixLakeError.ObjectStoreError({})".format(str(self))
1845
+ _UniffiTempPosixLakeError.ObjectStoreError = ObjectStoreError # type: ignore
1846
+ class ArrowError(_UniffiTempPosixLakeError):
1847
+ def __init__(self, message):
1848
+ super().__init__(", ".join([
1849
+ "message={!r}".format(message),
1850
+ ]))
1851
+ self.message = message
1852
+
1853
+ def __repr__(self):
1854
+ return "PosixLakeError.ArrowError({})".format(str(self))
1855
+ _UniffiTempPosixLakeError.ArrowError = ArrowError # type: ignore
1856
+ class ParquetError(_UniffiTempPosixLakeError):
1857
+ def __init__(self, message):
1858
+ super().__init__(", ".join([
1859
+ "message={!r}".format(message),
1860
+ ]))
1861
+ self.message = message
1862
+
1863
+ def __repr__(self):
1864
+ return "PosixLakeError.ParquetError({})".format(str(self))
1865
+ _UniffiTempPosixLakeError.ParquetError = ParquetError # type: ignore
1866
+ class DatabaseNotFound(_UniffiTempPosixLakeError):
1867
+ def __init__(self, message):
1868
+ super().__init__(", ".join([
1869
+ "message={!r}".format(message),
1870
+ ]))
1871
+ self.message = message
1872
+
1873
+ def __repr__(self):
1874
+ return "PosixLakeError.DatabaseNotFound({})".format(str(self))
1875
+ _UniffiTempPosixLakeError.DatabaseNotFound = DatabaseNotFound # type: ignore
1876
+ class RecordNotFound(_UniffiTempPosixLakeError):
1877
+ def __init__(self, message):
1878
+ super().__init__(", ".join([
1879
+ "message={!r}".format(message),
1880
+ ]))
1881
+ self.message = message
1882
+
1883
+ def __repr__(self):
1884
+ return "PosixLakeError.RecordNotFound({})".format(str(self))
1885
+ _UniffiTempPosixLakeError.RecordNotFound = RecordNotFound # type: ignore
1886
+ class DatabaseAlreadyExists(_UniffiTempPosixLakeError):
1887
+ def __init__(self, message):
1888
+ super().__init__(", ".join([
1889
+ "message={!r}".format(message),
1890
+ ]))
1891
+ self.message = message
1892
+
1893
+ def __repr__(self):
1894
+ return "PosixLakeError.DatabaseAlreadyExists({})".format(str(self))
1895
+ _UniffiTempPosixLakeError.DatabaseAlreadyExists = DatabaseAlreadyExists # type: ignore
1896
+ class InvalidOperation(_UniffiTempPosixLakeError):
1897
+ def __init__(self, message):
1898
+ super().__init__(", ".join([
1899
+ "message={!r}".format(message),
1900
+ ]))
1901
+ self.message = message
1902
+
1903
+ def __repr__(self):
1904
+ return "PosixLakeError.InvalidOperation({})".format(str(self))
1905
+ _UniffiTempPosixLakeError.InvalidOperation = InvalidOperation # type: ignore
1906
+ class TransactionConflict(_UniffiTempPosixLakeError):
1907
+ def __init__(self, message):
1908
+ super().__init__(", ".join([
1909
+ "message={!r}".format(message),
1910
+ ]))
1911
+ self.message = message
1912
+
1913
+ def __repr__(self):
1914
+ return "PosixLakeError.TransactionConflict({})".format(str(self))
1915
+ _UniffiTempPosixLakeError.TransactionConflict = TransactionConflict # type: ignore
1916
+ class WalError(_UniffiTempPosixLakeError):
1917
+ def __init__(self, message):
1918
+ super().__init__(", ".join([
1919
+ "message={!r}".format(message),
1920
+ ]))
1921
+ self.message = message
1922
+
1923
+ def __repr__(self):
1924
+ return "PosixLakeError.WalError({})".format(str(self))
1925
+ _UniffiTempPosixLakeError.WalError = WalError # type: ignore
1926
+ class BincodeError(_UniffiTempPosixLakeError):
1927
+ def __init__(self, message):
1928
+ super().__init__(", ".join([
1929
+ "message={!r}".format(message),
1930
+ ]))
1931
+ self.message = message
1932
+
1933
+ def __repr__(self):
1934
+ return "PosixLakeError.BincodeError({})".format(str(self))
1935
+ _UniffiTempPosixLakeError.BincodeError = BincodeError # type: ignore
1936
+ class DeltaLakeError(_UniffiTempPosixLakeError):
1937
+ def __init__(self, message):
1938
+ super().__init__(", ".join([
1939
+ "message={!r}".format(message),
1940
+ ]))
1941
+ self.message = message
1942
+
1943
+ def __repr__(self):
1944
+ return "PosixLakeError.DeltaLakeError({})".format(str(self))
1945
+ _UniffiTempPosixLakeError.DeltaLakeError = DeltaLakeError # type: ignore
1946
+ class Other(_UniffiTempPosixLakeError):
1947
+ def __init__(self, message):
1948
+ super().__init__(", ".join([
1949
+ "message={!r}".format(message),
1950
+ ]))
1951
+ self.message = message
1952
+
1953
+ def __repr__(self):
1954
+ return "PosixLakeError.Other({})".format(str(self))
1955
+ _UniffiTempPosixLakeError.Other = Other # type: ignore
1956
+
1957
+ PosixLakeError = _UniffiTempPosixLakeError # type: ignore
1958
+ del _UniffiTempPosixLakeError
1959
+
1960
+
1961
+ class _UniffiConverterTypePosixLakeError(_UniffiConverterRustBuffer):
1962
+ @staticmethod
1963
+ def read(buf):
1964
+ variant = buf.read_i32()
1965
+ if variant == 1:
1966
+ return PosixLakeError.IoError(
1967
+ _UniffiConverterString.read(buf),
1968
+ )
1969
+ if variant == 2:
1970
+ return PosixLakeError.SerializationError(
1971
+ _UniffiConverterString.read(buf),
1972
+ )
1973
+ if variant == 3:
1974
+ return PosixLakeError.ObjectStoreError(
1975
+ _UniffiConverterString.read(buf),
1976
+ )
1977
+ if variant == 4:
1978
+ return PosixLakeError.ArrowError(
1979
+ _UniffiConverterString.read(buf),
1980
+ )
1981
+ if variant == 5:
1982
+ return PosixLakeError.ParquetError(
1983
+ _UniffiConverterString.read(buf),
1984
+ )
1985
+ if variant == 6:
1986
+ return PosixLakeError.DatabaseNotFound(
1987
+ _UniffiConverterString.read(buf),
1988
+ )
1989
+ if variant == 7:
1990
+ return PosixLakeError.RecordNotFound(
1991
+ _UniffiConverterString.read(buf),
1992
+ )
1993
+ if variant == 8:
1994
+ return PosixLakeError.DatabaseAlreadyExists(
1995
+ _UniffiConverterString.read(buf),
1996
+ )
1997
+ if variant == 9:
1998
+ return PosixLakeError.InvalidOperation(
1999
+ _UniffiConverterString.read(buf),
2000
+ )
2001
+ if variant == 10:
2002
+ return PosixLakeError.TransactionConflict(
2003
+ _UniffiConverterString.read(buf),
2004
+ )
2005
+ if variant == 11:
2006
+ return PosixLakeError.WalError(
2007
+ _UniffiConverterString.read(buf),
2008
+ )
2009
+ if variant == 12:
2010
+ return PosixLakeError.BincodeError(
2011
+ _UniffiConverterString.read(buf),
2012
+ )
2013
+ if variant == 13:
2014
+ return PosixLakeError.DeltaLakeError(
2015
+ _UniffiConverterString.read(buf),
2016
+ )
2017
+ if variant == 14:
2018
+ return PosixLakeError.Other(
2019
+ _UniffiConverterString.read(buf),
2020
+ )
2021
+ raise InternalError("Raw enum value doesn't match any cases")
2022
+
2023
+ @staticmethod
2024
+ def check_lower(value):
2025
+ if isinstance(value, PosixLakeError.IoError):
2026
+ _UniffiConverterString.check_lower(value.message)
2027
+ return
2028
+ if isinstance(value, PosixLakeError.SerializationError):
2029
+ _UniffiConverterString.check_lower(value.message)
2030
+ return
2031
+ if isinstance(value, PosixLakeError.ObjectStoreError):
2032
+ _UniffiConverterString.check_lower(value.message)
2033
+ return
2034
+ if isinstance(value, PosixLakeError.ArrowError):
2035
+ _UniffiConverterString.check_lower(value.message)
2036
+ return
2037
+ if isinstance(value, PosixLakeError.ParquetError):
2038
+ _UniffiConverterString.check_lower(value.message)
2039
+ return
2040
+ if isinstance(value, PosixLakeError.DatabaseNotFound):
2041
+ _UniffiConverterString.check_lower(value.message)
2042
+ return
2043
+ if isinstance(value, PosixLakeError.RecordNotFound):
2044
+ _UniffiConverterString.check_lower(value.message)
2045
+ return
2046
+ if isinstance(value, PosixLakeError.DatabaseAlreadyExists):
2047
+ _UniffiConverterString.check_lower(value.message)
2048
+ return
2049
+ if isinstance(value, PosixLakeError.InvalidOperation):
2050
+ _UniffiConverterString.check_lower(value.message)
2051
+ return
2052
+ if isinstance(value, PosixLakeError.TransactionConflict):
2053
+ _UniffiConverterString.check_lower(value.message)
2054
+ return
2055
+ if isinstance(value, PosixLakeError.WalError):
2056
+ _UniffiConverterString.check_lower(value.message)
2057
+ return
2058
+ if isinstance(value, PosixLakeError.BincodeError):
2059
+ _UniffiConverterString.check_lower(value.message)
2060
+ return
2061
+ if isinstance(value, PosixLakeError.DeltaLakeError):
2062
+ _UniffiConverterString.check_lower(value.message)
2063
+ return
2064
+ if isinstance(value, PosixLakeError.Other):
2065
+ _UniffiConverterString.check_lower(value.message)
2066
+ return
2067
+
2068
+ @staticmethod
2069
+ def write(value, buf):
2070
+ if isinstance(value, PosixLakeError.IoError):
2071
+ buf.write_i32(1)
2072
+ _UniffiConverterString.write(value.message, buf)
2073
+ if isinstance(value, PosixLakeError.SerializationError):
2074
+ buf.write_i32(2)
2075
+ _UniffiConverterString.write(value.message, buf)
2076
+ if isinstance(value, PosixLakeError.ObjectStoreError):
2077
+ buf.write_i32(3)
2078
+ _UniffiConverterString.write(value.message, buf)
2079
+ if isinstance(value, PosixLakeError.ArrowError):
2080
+ buf.write_i32(4)
2081
+ _UniffiConverterString.write(value.message, buf)
2082
+ if isinstance(value, PosixLakeError.ParquetError):
2083
+ buf.write_i32(5)
2084
+ _UniffiConverterString.write(value.message, buf)
2085
+ if isinstance(value, PosixLakeError.DatabaseNotFound):
2086
+ buf.write_i32(6)
2087
+ _UniffiConverterString.write(value.message, buf)
2088
+ if isinstance(value, PosixLakeError.RecordNotFound):
2089
+ buf.write_i32(7)
2090
+ _UniffiConverterString.write(value.message, buf)
2091
+ if isinstance(value, PosixLakeError.DatabaseAlreadyExists):
2092
+ buf.write_i32(8)
2093
+ _UniffiConverterString.write(value.message, buf)
2094
+ if isinstance(value, PosixLakeError.InvalidOperation):
2095
+ buf.write_i32(9)
2096
+ _UniffiConverterString.write(value.message, buf)
2097
+ if isinstance(value, PosixLakeError.TransactionConflict):
2098
+ buf.write_i32(10)
2099
+ _UniffiConverterString.write(value.message, buf)
2100
+ if isinstance(value, PosixLakeError.WalError):
2101
+ buf.write_i32(11)
2102
+ _UniffiConverterString.write(value.message, buf)
2103
+ if isinstance(value, PosixLakeError.BincodeError):
2104
+ buf.write_i32(12)
2105
+ _UniffiConverterString.write(value.message, buf)
2106
+ if isinstance(value, PosixLakeError.DeltaLakeError):
2107
+ buf.write_i32(13)
2108
+ _UniffiConverterString.write(value.message, buf)
2109
+ if isinstance(value, PosixLakeError.Other):
2110
+ buf.write_i32(14)
2111
+ _UniffiConverterString.write(value.message, buf)
2112
+
2113
+
2114
+
2115
+ class _UniffiConverterSequenceString(_UniffiConverterRustBuffer):
2116
+ @classmethod
2117
+ def check_lower(cls, value):
2118
+ for item in value:
2119
+ _UniffiConverterString.check_lower(item)
2120
+
2121
+ @classmethod
2122
+ def write(cls, value, buf):
2123
+ items = len(value)
2124
+ buf.write_i32(items)
2125
+ for item in value:
2126
+ _UniffiConverterString.write(item, buf)
2127
+
2128
+ @classmethod
2129
+ def read(cls, buf):
2130
+ count = buf.read_i32()
2131
+ if count < 0:
2132
+ raise InternalError("Unexpected negative sequence length")
2133
+
2134
+ return [
2135
+ _UniffiConverterString.read(buf) for i in range(count)
2136
+ ]
2137
+
2138
+
2139
+
2140
+ class _UniffiConverterSequenceTypeField(_UniffiConverterRustBuffer):
2141
+ @classmethod
2142
+ def check_lower(cls, value):
2143
+ for item in value:
2144
+ _UniffiConverterTypeField.check_lower(item)
2145
+
2146
+ @classmethod
2147
+ def write(cls, value, buf):
2148
+ items = len(value)
2149
+ buf.write_i32(items)
2150
+ for item in value:
2151
+ _UniffiConverterTypeField.write(item, buf)
2152
+
2153
+ @classmethod
2154
+ def read(cls, buf):
2155
+ count = buf.read_i32()
2156
+ if count < 0:
2157
+ raise InternalError("Unexpected negative sequence length")
2158
+
2159
+ return [
2160
+ _UniffiConverterTypeField.read(buf) for i in range(count)
2161
+ ]
2162
+
2163
+
2164
+
2165
+ class _UniffiConverterSequenceTypeRow(_UniffiConverterRustBuffer):
2166
+ @classmethod
2167
+ def check_lower(cls, value):
2168
+ for item in value:
2169
+ _UniffiConverterTypeRow.check_lower(item)
2170
+
2171
+ @classmethod
2172
+ def write(cls, value, buf):
2173
+ items = len(value)
2174
+ buf.write_i32(items)
2175
+ for item in value:
2176
+ _UniffiConverterTypeRow.write(item, buf)
2177
+
2178
+ @classmethod
2179
+ def read(cls, buf):
2180
+ count = buf.read_i32()
2181
+ if count < 0:
2182
+ raise InternalError("Unexpected negative sequence length")
2183
+
2184
+ return [
2185
+ _UniffiConverterTypeRow.read(buf) for i in range(count)
2186
+ ]
2187
+
2188
+
2189
+
2190
+ class _UniffiConverterMapStringString(_UniffiConverterRustBuffer):
2191
+ @classmethod
2192
+ def check_lower(cls, items):
2193
+ for (key, value) in items.items():
2194
+ _UniffiConverterString.check_lower(key)
2195
+ _UniffiConverterString.check_lower(value)
2196
+
2197
+ @classmethod
2198
+ def write(cls, items, buf):
2199
+ buf.write_i32(len(items))
2200
+ for (key, value) in items.items():
2201
+ _UniffiConverterString.write(key, buf)
2202
+ _UniffiConverterString.write(value, buf)
2203
+
2204
+ @classmethod
2205
+ def read(cls, buf):
2206
+ count = buf.read_i32()
2207
+ if count < 0:
2208
+ raise InternalError("Unexpected negative map size")
2209
+
2210
+ # It would be nice to use a dict comprehension,
2211
+ # but in Python 3.7 and before the evaluation order is not according to spec,
2212
+ # so we we're reading the value before the key.
2213
+ # This loop makes the order explicit: first reading the key, then the value.
2214
+ d = {}
2215
+ for i in range(count):
2216
+ key = _UniffiConverterString.read(buf)
2217
+ val = _UniffiConverterString.read(buf)
2218
+ d[key] = val
2219
+ return d
2220
+
2221
+ # objects.
2222
+ class DatabaseOpsProtocol(typing.Protocol):
2223
+ """
2224
+ Main DatabaseOps wrapper for Python
2225
+ """
2226
+
2227
+ def backup(self, backup_path: "str"):
2228
+ """
2229
+ Create a full backup
2230
+ """
2231
+
2232
+ raise NotImplementedError
2233
+ def backup_incremental(self, base_backup_path: "str",incremental_path: "str"):
2234
+ """
2235
+ Create an incremental backup
2236
+ """
2237
+
2238
+ raise NotImplementedError
2239
+ def create_user(self, username: "str",password: "str",roles: "typing.List[str]"):
2240
+ """
2241
+ Create a new user with roles
2242
+ """
2243
+
2244
+ raise NotImplementedError
2245
+ def delete_rows_where(self, predicate: "str"):
2246
+ """
2247
+ Delete rows matching a WHERE clause
2248
+ """
2249
+
2250
+ raise NotImplementedError
2251
+ def flush_write_buffer(self, ):
2252
+ """
2253
+ Flush any buffered writes to Delta Lake immediately
2254
+
2255
+ Forces all buffered data from insert_buffered_json() to be committed.
2256
+ Call this before reading data to ensure consistency, or at shutdown.
2257
+ """
2258
+
2259
+ raise NotImplementedError
2260
+ def get_base_path(self, ):
2261
+ """
2262
+ Get database base path
2263
+ """
2264
+
2265
+ raise NotImplementedError
2266
+ def get_data_skipping_stats(self, ):
2267
+ """
2268
+ Get data skipping statistics
2269
+ """
2270
+
2271
+ raise NotImplementedError
2272
+ def get_metrics(self, ):
2273
+ """
2274
+ Get database metrics
2275
+ """
2276
+
2277
+ raise NotImplementedError
2278
+ def get_schema(self, ):
2279
+ """
2280
+ Get database schema
2281
+ """
2282
+
2283
+ raise NotImplementedError
2284
+ def health_check(self, ):
2285
+ """
2286
+ Get health status
2287
+ """
2288
+
2289
+ raise NotImplementedError
2290
+ def insert_buffered_json(self, json_data: "str"):
2291
+ """
2292
+ Insert data from JSON string with buffering for better performance
2293
+
2294
+ This method buffers small writes and automatically flushes when the buffer
2295
+ reaches 1000 rows (default). Use this for many small inserts to reduce
2296
+ transaction overhead.
2297
+
2298
+ Returns the number of rows buffered (not necessarily committed yet).
2299
+ Call flush_write_buffer() to force a commit.
2300
+ """
2301
+
2302
+ raise NotImplementedError
2303
+ def insert_json(self, json_data: "str"):
2304
+ """
2305
+ Insert data from JSON string
2306
+ """
2307
+
2308
+ raise NotImplementedError
2309
+ def merge_json(self, json_data: "str",join_column: "str"):
2310
+ """
2311
+ Execute MERGE (UPSERT) operation from JSON data
2312
+
2313
+ JSON must be an array of objects with an "_op" field specifying the operation:
2314
+ - "INSERT": Insert new rows
2315
+ - "UPDATE": Update existing rows
2316
+ - "DELETE": Delete existing rows
2317
+
2318
+ The join is performed on the specified join_column (typically "id").
2319
+
2320
+ Returns a JSON string with merge metrics: rows_inserted, rows_updated, rows_deleted
2321
+ """
2322
+
2323
+ raise NotImplementedError
2324
+ def optimize(self, ):
2325
+ """
2326
+ Run OPTIMIZE to compact files
2327
+ """
2328
+
2329
+ raise NotImplementedError
2330
+ def optimize_with_filter(self, filter: "str"):
2331
+ """
2332
+ Run OPTIMIZE with a filter
2333
+ """
2334
+
2335
+ raise NotImplementedError
2336
+ def optimize_with_target_size(self, target_size_bytes: "int"):
2337
+ """
2338
+ Run OPTIMIZE with a target file size
2339
+ """
2340
+
2341
+ raise NotImplementedError
2342
+ def query(self, sql: "str"):
2343
+ """
2344
+ Query data with SQL
2345
+ """
2346
+
2347
+ raise NotImplementedError
2348
+ def query_json(self, sql: "str"):
2349
+ """
2350
+ Query data and return as JSON string
2351
+ """
2352
+
2353
+ raise NotImplementedError
2354
+ def query_timestamp(self, sql: "str",timestamp_ms: "int"):
2355
+ """
2356
+ Query data at a specific timestamp (milliseconds since epoch)
2357
+ """
2358
+
2359
+ raise NotImplementedError
2360
+ def query_timestamp_json(self, sql: "str",timestamp_ms: "int"):
2361
+ """
2362
+ Query data at a specific timestamp and return as JSON
2363
+ """
2364
+
2365
+ raise NotImplementedError
2366
+ def query_version(self, sql: "str",version: "int"):
2367
+ """
2368
+ Query data at a specific version
2369
+ """
2370
+
2371
+ raise NotImplementedError
2372
+ def query_version_json(self, sql: "str",version: "int"):
2373
+ """
2374
+ Query data at a specific version and return as JSON
2375
+ """
2376
+
2377
+ raise NotImplementedError
2378
+ def vacuum(self, retention_hours: "int"):
2379
+ """
2380
+ Run VACUUM to remove old files
2381
+ """
2382
+
2383
+ raise NotImplementedError
2384
+ def vacuum_dry_run(self, retention_hours: "int"):
2385
+ """
2386
+ Run VACUUM dry run to see what would be deleted
2387
+ """
2388
+
2389
+ raise NotImplementedError
2390
+ def zorder(self, columns: "typing.List[str]"):
2391
+ """
2392
+ Run Z-ORDER on specified columns
2393
+ """
2394
+
2395
+ raise NotImplementedError
2396
+ # DatabaseOps is a Rust-only trait - it's a wrapper around a Rust implementation.
2397
+ class DatabaseOps():
2398
+ """
2399
+ Main DatabaseOps wrapper for Python
2400
+ """
2401
+
2402
+ _pointer: ctypes.c_void_p
2403
+
2404
+ def __init__(self, *args, **kwargs):
2405
+ raise ValueError("This class has no default constructor")
2406
+
2407
+ def __del__(self):
2408
+ # In case of partial initialization of instances.
2409
+ pointer = getattr(self, "_pointer", None)
2410
+ if pointer is not None:
2411
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_free_databaseops, pointer)
2412
+
2413
+ def _uniffi_clone_pointer(self):
2414
+ return _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_clone_databaseops, self._pointer)
2415
+
2416
+ # Used by alternative constructors or any methods which return this type.
2417
+ @classmethod
2418
+ def _make_instance_(cls, pointer):
2419
+ # Lightly yucky way to bypass the usual __init__ logic
2420
+ # and just create a new instance with the required pointer.
2421
+ inst = cls.__new__(cls)
2422
+ inst._pointer = pointer
2423
+ return inst
2424
+ @classmethod
2425
+ def create(cls, path: "str",schema: "Schema"):
2426
+ """
2427
+ Create a new database with the given schema
2428
+ """
2429
+
2430
+ _UniffiConverterString.check_lower(path)
2431
+
2432
+ _UniffiConverterTypeSchema.check_lower(schema)
2433
+
2434
+ # Call the (fallible) function before creating any half-baked object instances.
2435
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create,
2436
+ _UniffiConverterString.lower(path),
2437
+ _UniffiConverterTypeSchema.lower(schema))
2438
+ return cls._make_instance_(pointer)
2439
+
2440
+ @classmethod
2441
+ def create_from_csv(cls, db_path: "str",csv_path: "str"):
2442
+ """
2443
+ Create a new database by importing from a CSV file
2444
+
2445
+ Schema is automatically inferred from the CSV:
2446
+ - Column names from header row
2447
+ - Types inferred from first 10 data rows (Int64, Float64, Boolean, or String)
2448
+ - All columns nullable
2449
+ """
2450
+
2451
+ _UniffiConverterString.check_lower(db_path)
2452
+
2453
+ _UniffiConverterString.check_lower(csv_path)
2454
+
2455
+ # Call the (fallible) function before creating any half-baked object instances.
2456
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_from_csv,
2457
+ _UniffiConverterString.lower(db_path),
2458
+ _UniffiConverterString.lower(csv_path))
2459
+ return cls._make_instance_(pointer)
2460
+
2461
+ @classmethod
2462
+ def create_from_parquet(cls, db_path: "str",parquet_path: "str"):
2463
+ """
2464
+ Create a new database by importing from Parquet file(s)
2465
+
2466
+ Schema is read directly from Parquet metadata.
2467
+ Supports single file or glob patterns (e.g., "data/*.parquet").
2468
+ """
2469
+
2470
+ _UniffiConverterString.check_lower(db_path)
2471
+
2472
+ _UniffiConverterString.check_lower(parquet_path)
2473
+
2474
+ # Call the (fallible) function before creating any half-baked object instances.
2475
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_from_parquet,
2476
+ _UniffiConverterString.lower(db_path),
2477
+ _UniffiConverterString.lower(parquet_path))
2478
+ return cls._make_instance_(pointer)
2479
+
2480
+ @classmethod
2481
+ def create_with_auth(cls, path: "str",schema: "Schema",auth_enabled: "bool"):
2482
+ """
2483
+ Create a new database with authentication enabled
2484
+ """
2485
+
2486
+ _UniffiConverterString.check_lower(path)
2487
+
2488
+ _UniffiConverterTypeSchema.check_lower(schema)
2489
+
2490
+ _UniffiConverterBool.check_lower(auth_enabled)
2491
+
2492
+ # Call the (fallible) function before creating any half-baked object instances.
2493
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_with_auth,
2494
+ _UniffiConverterString.lower(path),
2495
+ _UniffiConverterTypeSchema.lower(schema),
2496
+ _UniffiConverterBool.lower(auth_enabled))
2497
+ return cls._make_instance_(pointer)
2498
+
2499
+ @classmethod
2500
+ def create_with_s3(cls, s3_path: "str",schema: "Schema",s3_config: "S3Config"):
2501
+ """
2502
+ Create a new database on S3
2503
+ """
2504
+
2505
+ _UniffiConverterString.check_lower(s3_path)
2506
+
2507
+ _UniffiConverterTypeSchema.check_lower(schema)
2508
+
2509
+ _UniffiConverterTypeS3Config.check_lower(s3_config)
2510
+
2511
+ # Call the (fallible) function before creating any half-baked object instances.
2512
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_create_with_s3,
2513
+ _UniffiConverterString.lower(s3_path),
2514
+ _UniffiConverterTypeSchema.lower(schema),
2515
+ _UniffiConverterTypeS3Config.lower(s3_config))
2516
+ return cls._make_instance_(pointer)
2517
+
2518
+ @classmethod
2519
+ def open(cls, path: "str"):
2520
+ """
2521
+ Open an existing database
2522
+ """
2523
+
2524
+ _UniffiConverterString.check_lower(path)
2525
+
2526
+ # Call the (fallible) function before creating any half-baked object instances.
2527
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open,
2528
+ _UniffiConverterString.lower(path))
2529
+ return cls._make_instance_(pointer)
2530
+
2531
+ @classmethod
2532
+ def open_with_credentials(cls, path: "str",username: "str",password: "str"):
2533
+ """
2534
+ Open an existing database with credentials
2535
+ """
2536
+
2537
+ _UniffiConverterString.check_lower(path)
2538
+
2539
+ _UniffiConverterString.check_lower(username)
2540
+
2541
+ _UniffiConverterString.check_lower(password)
2542
+
2543
+ # Call the (fallible) function before creating any half-baked object instances.
2544
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open_with_credentials,
2545
+ _UniffiConverterString.lower(path),
2546
+ _UniffiConverterString.lower(username),
2547
+ _UniffiConverterString.lower(password))
2548
+ return cls._make_instance_(pointer)
2549
+
2550
+ @classmethod
2551
+ def open_with_s3(cls, s3_path: "str",s3_config: "S3Config"):
2552
+ """
2553
+ Open an existing database on S3
2554
+ """
2555
+
2556
+ _UniffiConverterString.check_lower(s3_path)
2557
+
2558
+ _UniffiConverterTypeS3Config.check_lower(s3_config)
2559
+
2560
+ # Call the (fallible) function before creating any half-baked object instances.
2561
+ pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_databaseops_open_with_s3,
2562
+ _UniffiConverterString.lower(s3_path),
2563
+ _UniffiConverterTypeS3Config.lower(s3_config))
2564
+ return cls._make_instance_(pointer)
2565
+
2566
+
2567
+
2568
+ def backup(self, backup_path: "str") -> None:
2569
+ """
2570
+ Create a full backup
2571
+ """
2572
+
2573
+ _UniffiConverterString.check_lower(backup_path)
2574
+
2575
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_backup,self._uniffi_clone_pointer(),
2576
+ _UniffiConverterString.lower(backup_path))
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+
2583
+ def backup_incremental(self, base_backup_path: "str",incremental_path: "str") -> None:
2584
+ """
2585
+ Create an incremental backup
2586
+ """
2587
+
2588
+ _UniffiConverterString.check_lower(base_backup_path)
2589
+
2590
+ _UniffiConverterString.check_lower(incremental_path)
2591
+
2592
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_backup_incremental,self._uniffi_clone_pointer(),
2593
+ _UniffiConverterString.lower(base_backup_path),
2594
+ _UniffiConverterString.lower(incremental_path))
2595
+
2596
+
2597
+
2598
+
2599
+
2600
+
2601
+ def create_user(self, username: "str",password: "str",roles: "typing.List[str]") -> None:
2602
+ """
2603
+ Create a new user with roles
2604
+ """
2605
+
2606
+ _UniffiConverterString.check_lower(username)
2607
+
2608
+ _UniffiConverterString.check_lower(password)
2609
+
2610
+ _UniffiConverterSequenceString.check_lower(roles)
2611
+
2612
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_create_user,self._uniffi_clone_pointer(),
2613
+ _UniffiConverterString.lower(username),
2614
+ _UniffiConverterString.lower(password),
2615
+ _UniffiConverterSequenceString.lower(roles))
2616
+
2617
+
2618
+
2619
+
2620
+
2621
+
2622
+ def delete_rows_where(self, predicate: "str") -> "int":
2623
+ """
2624
+ Delete rows matching a WHERE clause
2625
+ """
2626
+
2627
+ _UniffiConverterString.check_lower(predicate)
2628
+
2629
+ return _UniffiConverterUInt64.lift(
2630
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_delete_rows_where,self._uniffi_clone_pointer(),
2631
+ _UniffiConverterString.lower(predicate))
2632
+ )
2633
+
2634
+
2635
+
2636
+
2637
+
2638
+ def flush_write_buffer(self, ) -> None:
2639
+ """
2640
+ Flush any buffered writes to Delta Lake immediately
2641
+
2642
+ Forces all buffered data from insert_buffered_json() to be committed.
2643
+ Call this before reading data to ensure consistency, or at shutdown.
2644
+ """
2645
+
2646
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_flush_write_buffer,self._uniffi_clone_pointer(),)
2647
+
2648
+
2649
+
2650
+
2651
+
2652
+
2653
+ def get_base_path(self, ) -> "str":
2654
+ """
2655
+ Get database base path
2656
+ """
2657
+
2658
+ return _UniffiConverterString.lift(
2659
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_databaseops_get_base_path,self._uniffi_clone_pointer(),)
2660
+ )
2661
+
2662
+
2663
+
2664
+
2665
+
2666
+ def get_data_skipping_stats(self, ) -> "DataSkippingStats":
2667
+ """
2668
+ Get data skipping statistics
2669
+ """
2670
+
2671
+ return _UniffiConverterTypeDataSkippingStats.lift(
2672
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_get_data_skipping_stats,self._uniffi_clone_pointer(),)
2673
+ )
2674
+
2675
+
2676
+
2677
+
2678
+
2679
+ def get_metrics(self, ) -> "DatabaseMetrics":
2680
+ """
2681
+ Get database metrics
2682
+ """
2683
+
2684
+ return _UniffiConverterTypeDatabaseMetrics.lift(
2685
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_databaseops_get_metrics,self._uniffi_clone_pointer(),)
2686
+ )
2687
+
2688
+
2689
+
2690
+
2691
+
2692
+ def get_schema(self, ) -> "Schema":
2693
+ """
2694
+ Get database schema
2695
+ """
2696
+
2697
+ return _UniffiConverterTypeSchema.lift(
2698
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_databaseops_get_schema,self._uniffi_clone_pointer(),)
2699
+ )
2700
+
2701
+
2702
+
2703
+
2704
+
2705
+ def health_check(self, ) -> "HealthStatus":
2706
+ """
2707
+ Get health status
2708
+ """
2709
+
2710
+ return _UniffiConverterTypeHealthStatus.lift(
2711
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_databaseops_health_check,self._uniffi_clone_pointer(),)
2712
+ )
2713
+
2714
+
2715
+
2716
+
2717
+
2718
+ def insert_buffered_json(self, json_data: "str") -> "int":
2719
+ """
2720
+ Insert data from JSON string with buffering for better performance
2721
+
2722
+ This method buffers small writes and automatically flushes when the buffer
2723
+ reaches 1000 rows (default). Use this for many small inserts to reduce
2724
+ transaction overhead.
2725
+
2726
+ Returns the number of rows buffered (not necessarily committed yet).
2727
+ Call flush_write_buffer() to force a commit.
2728
+ """
2729
+
2730
+ _UniffiConverterString.check_lower(json_data)
2731
+
2732
+ return _UniffiConverterUInt64.lift(
2733
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_insert_buffered_json,self._uniffi_clone_pointer(),
2734
+ _UniffiConverterString.lower(json_data))
2735
+ )
2736
+
2737
+
2738
+
2739
+
2740
+
2741
+ def insert_json(self, json_data: "str") -> "int":
2742
+ """
2743
+ Insert data from JSON string
2744
+ """
2745
+
2746
+ _UniffiConverterString.check_lower(json_data)
2747
+
2748
+ return _UniffiConverterUInt64.lift(
2749
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_insert_json,self._uniffi_clone_pointer(),
2750
+ _UniffiConverterString.lower(json_data))
2751
+ )
2752
+
2753
+
2754
+
2755
+
2756
+
2757
+ def merge_json(self, json_data: "str",join_column: "str") -> "str":
2758
+ """
2759
+ Execute MERGE (UPSERT) operation from JSON data
2760
+
2761
+ JSON must be an array of objects with an "_op" field specifying the operation:
2762
+ - "INSERT": Insert new rows
2763
+ - "UPDATE": Update existing rows
2764
+ - "DELETE": Delete existing rows
2765
+
2766
+ The join is performed on the specified join_column (typically "id").
2767
+
2768
+ Returns a JSON string with merge metrics: rows_inserted, rows_updated, rows_deleted
2769
+ """
2770
+
2771
+ _UniffiConverterString.check_lower(json_data)
2772
+
2773
+ _UniffiConverterString.check_lower(join_column)
2774
+
2775
+ return _UniffiConverterString.lift(
2776
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_merge_json,self._uniffi_clone_pointer(),
2777
+ _UniffiConverterString.lower(json_data),
2778
+ _UniffiConverterString.lower(join_column))
2779
+ )
2780
+
2781
+
2782
+
2783
+
2784
+
2785
+ def optimize(self, ) -> None:
2786
+ """
2787
+ Run OPTIMIZE to compact files
2788
+ """
2789
+
2790
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize,self._uniffi_clone_pointer(),)
2791
+
2792
+
2793
+
2794
+
2795
+
2796
+
2797
+ def optimize_with_filter(self, filter: "str") -> None:
2798
+ """
2799
+ Run OPTIMIZE with a filter
2800
+ """
2801
+
2802
+ _UniffiConverterString.check_lower(filter)
2803
+
2804
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize_with_filter,self._uniffi_clone_pointer(),
2805
+ _UniffiConverterString.lower(filter))
2806
+
2807
+
2808
+
2809
+
2810
+
2811
+
2812
+ def optimize_with_target_size(self, target_size_bytes: "int") -> None:
2813
+ """
2814
+ Run OPTIMIZE with a target file size
2815
+ """
2816
+
2817
+ _UniffiConverterUInt64.check_lower(target_size_bytes)
2818
+
2819
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_optimize_with_target_size,self._uniffi_clone_pointer(),
2820
+ _UniffiConverterUInt64.lower(target_size_bytes))
2821
+
2822
+
2823
+
2824
+
2825
+
2826
+
2827
+ def query(self, sql: "str") -> "typing.List[Row]":
2828
+ """
2829
+ Query data with SQL
2830
+ """
2831
+
2832
+ _UniffiConverterString.check_lower(sql)
2833
+
2834
+ return _UniffiConverterSequenceTypeRow.lift(
2835
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_query,self._uniffi_clone_pointer(),
2836
+ _UniffiConverterString.lower(sql))
2837
+ )
2838
+
2839
+
2840
+
2841
+
2842
+
2843
+ def query_json(self, sql: "str") -> "str":
2844
+ """
2845
+ Query data and return as JSON string
2846
+ """
2847
+
2848
+ _UniffiConverterString.check_lower(sql)
2849
+
2850
+ return _UniffiConverterString.lift(
2851
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_query_json,self._uniffi_clone_pointer(),
2852
+ _UniffiConverterString.lower(sql))
2853
+ )
2854
+
2855
+
2856
+
2857
+
2858
+
2859
+ def query_timestamp(self, sql: "str",timestamp_ms: "int") -> "typing.List[Row]":
2860
+ """
2861
+ Query data at a specific timestamp (milliseconds since epoch)
2862
+ """
2863
+
2864
+ _UniffiConverterString.check_lower(sql)
2865
+
2866
+ _UniffiConverterInt64.check_lower(timestamp_ms)
2867
+
2868
+ return _UniffiConverterSequenceTypeRow.lift(
2869
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_query_timestamp,self._uniffi_clone_pointer(),
2870
+ _UniffiConverterString.lower(sql),
2871
+ _UniffiConverterInt64.lower(timestamp_ms))
2872
+ )
2873
+
2874
+
2875
+
2876
+
2877
+
2878
+ def query_timestamp_json(self, sql: "str",timestamp_ms: "int") -> "str":
2879
+ """
2880
+ Query data at a specific timestamp and return as JSON
2881
+ """
2882
+
2883
+ _UniffiConverterString.check_lower(sql)
2884
+
2885
+ _UniffiConverterInt64.check_lower(timestamp_ms)
2886
+
2887
+ return _UniffiConverterString.lift(
2888
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_query_timestamp_json,self._uniffi_clone_pointer(),
2889
+ _UniffiConverterString.lower(sql),
2890
+ _UniffiConverterInt64.lower(timestamp_ms))
2891
+ )
2892
+
2893
+
2894
+
2895
+
2896
+
2897
+ def query_version(self, sql: "str",version: "int") -> "typing.List[Row]":
2898
+ """
2899
+ Query data at a specific version
2900
+ """
2901
+
2902
+ _UniffiConverterString.check_lower(sql)
2903
+
2904
+ _UniffiConverterInt64.check_lower(version)
2905
+
2906
+ return _UniffiConverterSequenceTypeRow.lift(
2907
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_query_version,self._uniffi_clone_pointer(),
2908
+ _UniffiConverterString.lower(sql),
2909
+ _UniffiConverterInt64.lower(version))
2910
+ )
2911
+
2912
+
2913
+
2914
+
2915
+
2916
+ def query_version_json(self, sql: "str",version: "int") -> "str":
2917
+ """
2918
+ Query data at a specific version and return as JSON
2919
+ """
2920
+
2921
+ _UniffiConverterString.check_lower(sql)
2922
+
2923
+ _UniffiConverterInt64.check_lower(version)
2924
+
2925
+ return _UniffiConverterString.lift(
2926
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_query_version_json,self._uniffi_clone_pointer(),
2927
+ _UniffiConverterString.lower(sql),
2928
+ _UniffiConverterInt64.lower(version))
2929
+ )
2930
+
2931
+
2932
+
2933
+
2934
+
2935
+ def vacuum(self, retention_hours: "int") -> None:
2936
+ """
2937
+ Run VACUUM to remove old files
2938
+ """
2939
+
2940
+ _UniffiConverterUInt64.check_lower(retention_hours)
2941
+
2942
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_vacuum,self._uniffi_clone_pointer(),
2943
+ _UniffiConverterUInt64.lower(retention_hours))
2944
+
2945
+
2946
+
2947
+
2948
+
2949
+
2950
+ def vacuum_dry_run(self, retention_hours: "int") -> "typing.List[str]":
2951
+ """
2952
+ Run VACUUM dry run to see what would be deleted
2953
+ """
2954
+
2955
+ _UniffiConverterUInt64.check_lower(retention_hours)
2956
+
2957
+ return _UniffiConverterSequenceString.lift(
2958
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_vacuum_dry_run,self._uniffi_clone_pointer(),
2959
+ _UniffiConverterUInt64.lower(retention_hours))
2960
+ )
2961
+
2962
+
2963
+
2964
+
2965
+
2966
+ def zorder(self, columns: "typing.List[str]") -> None:
2967
+ """
2968
+ Run Z-ORDER on specified columns
2969
+ """
2970
+
2971
+ _UniffiConverterSequenceString.check_lower(columns)
2972
+
2973
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_databaseops_zorder,self._uniffi_clone_pointer(),
2974
+ _UniffiConverterSequenceString.lower(columns))
2975
+
2976
+
2977
+
2978
+
2979
+
2980
+
2981
+
2982
+ class _UniffiConverterTypeDatabaseOps:
2983
+
2984
+ @staticmethod
2985
+ def lift(value: int):
2986
+ return DatabaseOps._make_instance_(value)
2987
+
2988
+ @staticmethod
2989
+ def check_lower(value: DatabaseOps):
2990
+ if not isinstance(value, DatabaseOps):
2991
+ raise TypeError("Expected DatabaseOps instance, {} found".format(type(value).__name__))
2992
+
2993
+ @staticmethod
2994
+ def lower(value: DatabaseOpsProtocol):
2995
+ if not isinstance(value, DatabaseOps):
2996
+ raise TypeError("Expected DatabaseOps instance, {} found".format(type(value).__name__))
2997
+ return value._uniffi_clone_pointer()
2998
+
2999
+ @classmethod
3000
+ def read(cls, buf: _UniffiRustBuffer):
3001
+ ptr = buf.read_u64()
3002
+ if ptr == 0:
3003
+ raise InternalError("Raw pointer value was null")
3004
+ return cls.lift(ptr)
3005
+
3006
+ @classmethod
3007
+ def write(cls, value: DatabaseOpsProtocol, buf: _UniffiRustBuffer):
3008
+ buf.write_u64(cls.lower(value))
3009
+ class NfsServerProtocol(typing.Protocol):
3010
+ """
3011
+ NFS Server for exposing database as POSIX filesystem
3012
+ """
3013
+
3014
+ def get_mount_command(self, mount_point: "str"):
3015
+ """
3016
+ Get mount command for this platform
3017
+ """
3018
+
3019
+ raise NotImplementedError
3020
+ def get_port(self, ):
3021
+ """
3022
+ Get the port the server is listening on
3023
+ """
3024
+
3025
+ raise NotImplementedError
3026
+ def get_unmount_command(self, mount_point: "str"):
3027
+ """
3028
+ Get unmount command for this platform
3029
+ """
3030
+
3031
+ raise NotImplementedError
3032
+ def is_ready(self, ):
3033
+ """
3034
+ Check if server is ready
3035
+ """
3036
+
3037
+ raise NotImplementedError
3038
+ def shutdown(self, ):
3039
+ """
3040
+ Shutdown the NFS server
3041
+ """
3042
+
3043
+ raise NotImplementedError
3044
+ # NfsServer is a Rust-only trait - it's a wrapper around a Rust implementation.
3045
+ class NfsServer():
3046
+ """
3047
+ NFS Server for exposing database as POSIX filesystem
3048
+ """
3049
+
3050
+ _pointer: ctypes.c_void_p
3051
+ def __init__(self, db: "DatabaseOps",port: "int"):
3052
+ """
3053
+ Create and start a new NFS server
3054
+ """
3055
+
3056
+ _UniffiConverterTypeDatabaseOps.check_lower(db)
3057
+
3058
+ _UniffiConverterUInt16.check_lower(port)
3059
+
3060
+ self._pointer = _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_constructor_nfsserver_new,
3061
+ _UniffiConverterTypeDatabaseOps.lower(db),
3062
+ _UniffiConverterUInt16.lower(port))
3063
+
3064
+ def __del__(self):
3065
+ # In case of partial initialization of instances.
3066
+ pointer = getattr(self, "_pointer", None)
3067
+ if pointer is not None:
3068
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_free_nfsserver, pointer)
3069
+
3070
+ def _uniffi_clone_pointer(self):
3071
+ return _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_clone_nfsserver, self._pointer)
3072
+
3073
+ # Used by alternative constructors or any methods which return this type.
3074
+ @classmethod
3075
+ def _make_instance_(cls, pointer):
3076
+ # Lightly yucky way to bypass the usual __init__ logic
3077
+ # and just create a new instance with the required pointer.
3078
+ inst = cls.__new__(cls)
3079
+ inst._pointer = pointer
3080
+ return inst
3081
+
3082
+
3083
+ def get_mount_command(self, mount_point: "str") -> "typing.List[str]":
3084
+ """
3085
+ Get mount command for this platform
3086
+ """
3087
+
3088
+ _UniffiConverterString.check_lower(mount_point)
3089
+
3090
+ return _UniffiConverterSequenceString.lift(
3091
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_mount_command,self._uniffi_clone_pointer(),
3092
+ _UniffiConverterString.lower(mount_point))
3093
+ )
3094
+
3095
+
3096
+
3097
+
3098
+
3099
+ def get_port(self, ) -> "int":
3100
+ """
3101
+ Get the port the server is listening on
3102
+ """
3103
+
3104
+ return _UniffiConverterUInt16.lift(
3105
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_port,self._uniffi_clone_pointer(),)
3106
+ )
3107
+
3108
+
3109
+
3110
+
3111
+
3112
+ def get_unmount_command(self, mount_point: "str") -> "typing.List[str]":
3113
+ """
3114
+ Get unmount command for this platform
3115
+ """
3116
+
3117
+ _UniffiConverterString.check_lower(mount_point)
3118
+
3119
+ return _UniffiConverterSequenceString.lift(
3120
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_nfsserver_get_unmount_command,self._uniffi_clone_pointer(),
3121
+ _UniffiConverterString.lower(mount_point))
3122
+ )
3123
+
3124
+
3125
+
3126
+
3127
+
3128
+ def is_ready(self, ) -> "bool":
3129
+ """
3130
+ Check if server is ready
3131
+ """
3132
+
3133
+ return _UniffiConverterBool.lift(
3134
+ _uniffi_rust_call(_UniffiLib.uniffi_posixlake_fn_method_nfsserver_is_ready,self._uniffi_clone_pointer(),)
3135
+ )
3136
+
3137
+
3138
+
3139
+
3140
+
3141
+ def shutdown(self, ) -> None:
3142
+ """
3143
+ Shutdown the NFS server
3144
+ """
3145
+
3146
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_method_nfsserver_shutdown,self._uniffi_clone_pointer(),)
3147
+
3148
+
3149
+
3150
+
3151
+
3152
+
3153
+
3154
+ class _UniffiConverterTypeNfsServer:
3155
+
3156
+ @staticmethod
3157
+ def lift(value: int):
3158
+ return NfsServer._make_instance_(value)
3159
+
3160
+ @staticmethod
3161
+ def check_lower(value: NfsServer):
3162
+ if not isinstance(value, NfsServer):
3163
+ raise TypeError("Expected NfsServer instance, {} found".format(type(value).__name__))
3164
+
3165
+ @staticmethod
3166
+ def lower(value: NfsServerProtocol):
3167
+ if not isinstance(value, NfsServer):
3168
+ raise TypeError("Expected NfsServer instance, {} found".format(type(value).__name__))
3169
+ return value._uniffi_clone_pointer()
3170
+
3171
+ @classmethod
3172
+ def read(cls, buf: _UniffiRustBuffer):
3173
+ ptr = buf.read_u64()
3174
+ if ptr == 0:
3175
+ raise InternalError("Raw pointer value was null")
3176
+ return cls.lift(ptr)
3177
+
3178
+ @classmethod
3179
+ def write(cls, value: NfsServerProtocol, buf: _UniffiRustBuffer):
3180
+ buf.write_u64(cls.lower(value))
3181
+
3182
+ # Async support
3183
+
3184
+ def restore(backup_path: "str",restore_path: "str") -> None:
3185
+ _UniffiConverterString.check_lower(backup_path)
3186
+
3187
+ _UniffiConverterString.check_lower(restore_path)
3188
+
3189
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_func_restore,
3190
+ _UniffiConverterString.lower(backup_path),
3191
+ _UniffiConverterString.lower(restore_path))
3192
+
3193
+
3194
+ def restore_to_transaction(backup_path: "str",restore_path: "str",transaction_id: "int") -> None:
3195
+ _UniffiConverterString.check_lower(backup_path)
3196
+
3197
+ _UniffiConverterString.check_lower(restore_path)
3198
+
3199
+ _UniffiConverterUInt64.check_lower(transaction_id)
3200
+
3201
+ _uniffi_rust_call_with_error(_UniffiConverterTypePosixLakeError,_UniffiLib.uniffi_posixlake_fn_func_restore_to_transaction,
3202
+ _UniffiConverterString.lower(backup_path),
3203
+ _UniffiConverterString.lower(restore_path),
3204
+ _UniffiConverterUInt64.lower(transaction_id))
3205
+
3206
+
3207
+ __all__ = [
3208
+ "InternalError",
3209
+ "PosixLakeError",
3210
+ "DataSkippingStats",
3211
+ "DatabaseMetrics",
3212
+ "Field",
3213
+ "HealthStatus",
3214
+ "Row",
3215
+ "S3Config",
3216
+ "Schema",
3217
+ "restore",
3218
+ "restore_to_transaction",
3219
+ "DatabaseOps",
3220
+ "NfsServer",
3221
+ ]
3222
+