88/* *
99 * @file abi.h
1010 * @brief Raw C ABI interface for SpacetimeDB modules
11- *
11+ *
1212 * This file contains the raw C-compatible ABI declarations.
1313 * These functions use only C-compatible types and are suitable
1414 * for extern "C" linkage.
3535#define STDB_IMPORT_10_4 (name ) \
3636 __attribute__ ((import_module(" spacetime_10.4" ), import_name(#name))) extern
3737
38+ // Clear syscall is in spacetime_10.4
39+ #define STDB_IMPORT_10_5 (name ) \
40+ __attribute__ ((import_module(" spacetime_10.5" ), import_name(#name))) extern
41+
3842// Import opaque types into global namespace for C compatibility
3943using SpacetimeDB::Status;
4044using SpacetimeDB::TableId;
@@ -73,7 +77,7 @@ Status datastore_table_scan_bsatn(TableId table_id, RowIter* out);
7377STDB_IMPORT (datastore_index_scan_range_bsatn)
7478Status datastore_index_scan_range_bsatn(
7579 IndexId index_id, const uint8_t * prefix_ptr, size_t prefix_len, ColId prefix_elems,
76- const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
80+ const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
7781 RowIter* out);
7882
7983STDB_IMPORT_10_4 (datastore_index_scan_point_bsatn)
@@ -85,7 +89,7 @@ Status datastore_index_scan_point_bsatn(
8589STDB_IMPORT (datastore_btree_scan_bsatn)
8690Status datastore_btree_scan_bsatn(
8791 IndexId index_id, const uint8_t * prefix_ptr, size_t prefix_len, ColId prefix_elems,
88- const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
92+ const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
8993 RowIter* out);
9094
9195// ===== Row Iterator Operations =====
@@ -106,7 +110,7 @@ Status datastore_update_bsatn(TableId table_id, IndexId index_id, uint8_t* row_p
106110STDB_IMPORT (datastore_delete_by_index_scan_range_bsatn)
107111Status datastore_delete_by_index_scan_range_bsatn(
108112 IndexId index_id, const uint8_t * prefix_ptr, size_t prefix_len, ColId prefix_elems,
109- const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
113+ const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
110114 uint32_t * out);
111115
112116STDB_IMPORT_10_4 (datastore_delete_by_index_scan_point_bsatn)
@@ -117,14 +121,17 @@ Status datastore_delete_by_index_scan_point_bsatn(
117121STDB_IMPORT (datastore_delete_by_btree_scan_bsatn)
118122Status datastore_delete_by_btree_scan_bsatn(
119123 IndexId index_id, const uint8_t * prefix_ptr, size_t prefix_len, ColId prefix_elems,
120- const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
124+ const uint8_t * rstart_ptr, size_t rstart_len, const uint8_t * rend_ptr, size_t rend_len,
121125 uint32_t * out);
122126
123127STDB_IMPORT (datastore_delete_all_by_eq_bsatn)
124128Status datastore_delete_all_by_eq_bsatn(
125129 TableId table_id, const uint8_t * rel_ptr, size_t rel_len,
126130 uint32_t * out);
127131
132+ STDB_IMPORT_10_5 (datastore_clear)
133+ Status datastore_clear(TableId table_id, uint64_t * out);
134+
128135// ===== Bytes Source/Sink Operations =====
129136STDB_IMPORT (bytes_source_read)
130137int16_t bytes_source_read(BytesSource source, uint8_t * buffer_ptr, size_t * buffer_len_ptr);
@@ -205,8 +212,8 @@ int16_t __call_reducer__(
205212 uint32_t id,
206213 uint64_t sender_0, uint64_t sender_1, uint64_t sender_2, uint64_t sender_3,
207214 uint64_t conn_id_0, uint64_t conn_id_1,
208- uint64_t timestamp,
209- BytesSource args,
215+ uint64_t timestamp,
216+ BytesSource args,
210217 BytesSink error);
211218
212219// ========================================================================
@@ -223,4 +230,4 @@ int16_t __call_reducer__(
223230
224231#pragma clang diagnostic pop
225232
226- #endif // SPACETIMEDB_ABI_H
233+ #endif // SPACETIMEDB_ABI_H
0 commit comments