Skip to content

Commit 90f1297

Browse files
committed
Fix SDK issues for v0.3.6
- Added Tuple to typing imports to fix NameError - Commented out temporal graph FFI bindings (toondb_add_temporal_edge, toondb_query_temporal_graph, toondb_free_string) as they are not yet available in the native library - Fixes dlsym symbol not found errors on database initialization - All 59 tests now passing (44 FFI + 15 gRPC)
1 parent 5e5340c commit 90f1297

1 file changed

Lines changed: 37 additions & 34 deletions

File tree

src/toondb/database.py

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import sys
2424
import ctypes
2525
import warnings
26-
from typing import Optional, Dict, List, Union
26+
from typing import Optional, Dict, List, Union, Tuple
2727
from contextlib import contextmanager
2828
from .errors import (
2929
DatabaseError,
@@ -325,39 +325,42 @@ def _setup_bindings(cls):
325325
lib.toondb_get_table_index_policy.restype = ctypes.c_uint8
326326

327327
# Temporal Graph API
328-
# Define C_TemporalEdge structure first
329-
class C_TemporalEdge(ctypes.Structure):
330-
_fields_ = [
331-
("from_id", ctypes.c_char_p),
332-
("edge_type", ctypes.c_char_p),
333-
("to_id", ctypes.c_char_p),
334-
("valid_from", ctypes.c_uint64),
335-
("valid_until", ctypes.c_uint64),
336-
("properties_json", ctypes.c_char_p),
337-
]
338-
339-
# toondb_add_temporal_edge(ptr, namespace, edge) -> c_int
340-
lib.toondb_add_temporal_edge.argtypes = [
341-
ctypes.c_void_p, # ptr
342-
ctypes.c_char_p, # namespace
343-
C_TemporalEdge # edge struct by value
344-
]
345-
lib.toondb_add_temporal_edge.restype = ctypes.c_int
346-
347-
# toondb_query_temporal_graph(ptr, namespace, node_id, mode, timestamp, edge_type) -> *c_char
348-
lib.toondb_query_temporal_graph.argtypes = [
349-
ctypes.c_void_p, # ptr
350-
ctypes.c_char_p, # namespace
351-
ctypes.c_char_p, # node_id
352-
ctypes.c_int, # mode (0=CURRENT, 1=POINT_IN_TIME, 2=RANGE)
353-
ctypes.c_uint64, # timestamp
354-
ctypes.c_char_p # edge_type (optional, can be NULL)
355-
]
356-
lib.toondb_query_temporal_graph.restype = ctypes.c_char_p
357-
358-
# toondb_free_string(ptr) - Free strings returned by query_temporal_graph
359-
lib.toondb_free_string.argtypes = [ctypes.c_char_p]
360-
lib.toondb_free_string.restype = None
328+
# NOTE: These FFI bindings are not yet available in the native library
329+
# They are defined here for future compatibility but will cause dlsym errors if used
330+
# Commenting out until the native library exports these symbols
331+
332+
# class C_TemporalEdge(ctypes.Structure):
333+
# _fields_ = [
334+
# ("from_id", ctypes.c_char_p),
335+
# ("edge_type", ctypes.c_char_p),
336+
# ("to_id", ctypes.c_char_p),
337+
# ("valid_from", ctypes.c_uint64),
338+
# ("valid_until", ctypes.c_uint64),
339+
# ("properties_json", ctypes.c_char_p),
340+
# ]
341+
342+
# # toondb_add_temporal_edge(ptr, namespace, edge) -> c_int
343+
# lib.toondb_add_temporal_edge.argtypes = [
344+
# ctypes.c_void_p, # ptr
345+
# ctypes.c_char_p, # namespace
346+
# C_TemporalEdge # edge struct by value
347+
# ]
348+
# lib.toondb_add_temporal_edge.restype = ctypes.c_int
349+
350+
# # toondb_query_temporal_graph(ptr, namespace, node_id, mode, timestamp, edge_type) -> *c_char
351+
# lib.toondb_query_temporal_graph.argtypes = [
352+
# ctypes.c_void_p, # ptr
353+
# ctypes.c_char_p, # namespace
354+
# ctypes.c_char_p, # node_id
355+
# ctypes.c_int, # mode (0=CURRENT, 1=POINT_IN_TIME, 2=RANGE)
356+
# ctypes.c_uint64, # timestamp
357+
# ctypes.c_char_p # edge_type (optional, can be NULL)
358+
# ]
359+
# lib.toondb_query_temporal_graph.restype = ctypes.c_char_p
360+
361+
# # toondb_free_string(ptr) - Free strings returned by query_temporal_graph
362+
# lib.toondb_free_string.argtypes = [ctypes.c_char_p]
363+
# lib.toondb_free_string.restype = None
361364

362365

363366
class Transaction:

0 commit comments

Comments
 (0)