spacetimedb-sdk 2.3.0

A Rust SDK for clients to interface with SpacetimeDB
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
#[cfg(feature = "browser")]
use std::path::Path;

use spacetimedb_testing::sdk::{Test, TestBuilder};

fn platform_test_builder(client_project: &str, run_selector: Option<&str>) -> TestBuilder {
    let builder = Test::builder();
    let builder = builder.with_client(client_project);

    // Note: `run_selector` is intentionally interpreted differently by mode:
    // - Native mode uses it as a CLI subcommand (`cargo run -- <selector>`), with `None` => `cargo run`.
    // - Web mode assembles the Node/wasm-bindgen commands directly in this test harness.
    #[cfg(feature = "browser")]
    {
        let package_name = Path::new(client_project)
            .file_name()
            .and_then(|name| name.to_str())
            .expect("client project path should end in a UTF-8 directory name")
            .to_owned();
        let artifact_name = package_name.replace('-', "_");
        let target_dir = std::env::var("CARGO_TARGET_DIR").unwrap_or_else(|_| {
            // Cargo workspace members emit into the workspace target directory, not each crate's
            // local `./target`. Use `CARGO_TARGET_DIR` when set, otherwise fall back to the
            // workspace target.
            Path::new(env!("CARGO_MANIFEST_DIR"))
                .join("../../target")
                .to_string_lossy()
                .into_owned()
        });
        let bindgen_out_dir = format!("{client_project}/target/sdk-test-web-bindgen/{package_name}");
        let wasm_path = format!("{target_dir}/wasm32-unknown-unknown/debug/deps/{artifact_name}.wasm");
        let js_module = format!("{bindgen_out_dir}/{artifact_name}.js");
        let js_module_cjs = format!("{bindgen_out_dir}/{artifact_name}.cjs");
        let build_command = "cargo build --target wasm32-unknown-unknown --no-default-features --features browser";
        let mkdir_command = shlex::try_join(["mkdir", "-p", bindgen_out_dir.as_str()])
            .expect("bindgen output path should be shell-quotable");
        let bindgen_command = shlex::try_join([
            "wasm-bindgen",
            "--target",
            "nodejs",
            "--out-dir",
            bindgen_out_dir.as_str(),
            wasm_path.as_str(),
        ])
        .expect("wasm-bindgen command should be shell-quotable");
        let cp_command = shlex::try_join(["cp", js_module.as_str(), js_module_cjs.as_str()])
            .expect("bindgen JS output paths should be shell-quotable");
        let compile_command = format!(
            "/bin/bash -lc \
             \"{build_command} \
             && {mkdir_command} \
             && {bindgen_command} \
             && {cp_command}\""
        );
        let js_module = format!("{bindgen_out_dir}/{artifact_name}.cjs");
        let run_selector = run_selector.unwrap_or_default();
        let node_script = format!(
            "(async () => {{ \
              const m = require({js_module:?}); \
              if (m.default) {{ await m.default(); }} \
              const run = m.run || m.main || m.start; \
              if (!run) throw new Error(\"No exported run/main/start function from wasm module\"); \
              const dbName = process.env.SPACETIME_SDK_TEST_DB_NAME; \
              if (!dbName) throw new Error(\"Missing SPACETIME_SDK_TEST_DB_NAME\"); \
              await run({run_selector:?}, dbName); \
              // These wasm clients run under Node rather than a browser. Some tests intentionally leave
              // websocket/event-loop work alive once their assertions are complete, so exit here to keep
              // non-lifecycle tests from hanging on leftover handles after `run()` has finished.
              process.exit(0);
            }})().catch((e) => {{ console.error(e); process.exit(1); }});"
        );
        let node_script = shlex::try_quote(&node_script).expect("inline Node script should be shell-quotable");
        let run_command = format!("node --experimental-websocket -e {node_script}");

        builder
            .with_compile_command(compile_command)
            .with_run_command(run_command)
    }

    #[cfg(not(feature = "browser"))]
    {
        let run_command = match run_selector {
            Some(subcommand) => format!("cargo run -- {}", subcommand),
            None => "cargo run".to_owned(),
        };

        builder
            .with_compile_command("cargo build")
            .with_run_command(run_command)
    }
}

macro_rules! declare_tests_with_suffix {
    ($lang:ident, $suffix:literal) => {
        mod $lang {
            use spacetimedb_testing::sdk::Test;

            const MODULE: &str = concat!("sdk-test", $suffix);
            const CLIENT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/test-client");

            fn make_test(subcommand: &str) -> Test {
                super::platform_test_builder(CLIENT, Some(subcommand))
                    .with_name(subcommand)
                    .with_module(MODULE)
                    .with_language("rust")
                    // We test against multiple modules in different languages,
                    // and as of writing (pgoldman 2026-02-12),
                    // some of those languages have not yet been updated to make scheduled and lifecycle reducers
                    // private by default. As such, generating only public items results in different bindings
                    // depending on which module is the source.
                    .with_generate_private_items(true)
                    .with_bindings_dir("src/module_bindings")
                    .build()
            }

            #[test]
            fn insert_primitive() {
                make_test("insert-primitive").run();
            }

            #[test]
            fn subscribe_and_cancel() {
                make_test("subscribe-and-cancel").run();
            }

            #[test]
            fn subscribe_and_unsubscribe() {
                make_test("subscribe-and-unsubscribe").run();
            }

            #[test]
            fn subscription_error_smoke_test() {
                make_test("subscription-error-smoke-test").run();
            }
            #[test]
            fn delete_primitive() {
                make_test("delete-primitive").run();
            }

            #[test]
            fn update_primitive() {
                make_test("update-primitive").run();
            }

            #[test]
            fn insert_identity() {
                make_test("insert-identity").run();
            }

            #[test]
            fn insert_caller_identity() {
                make_test("insert-caller-identity").run();
            }

            #[test]
            fn delete_identity() {
                make_test("delete-identity").run();
            }

            #[test]
            fn update_identity() {
                make_test("delete-identity").run();
            }

            #[test]
            fn insert_connection_id() {
                make_test("insert-connection-id").run();
            }

            #[test]
            fn insert_caller_connection_id() {
                make_test("insert-caller-connection-id").run();
            }

            #[test]
            fn delete_connection_id() {
                make_test("delete-connection-id").run();
            }

            #[test]
            fn update_connection_id() {
                make_test("delete-connection-id").run();
            }

            #[test]
            fn insert_timestamp() {
                make_test("insert-timestamp").run();
            }

            #[test]
            fn insert_call_uuid_v4() {
                make_test("insert-call-uuid-v4").run();
            }

            #[test]
            fn insert_call_uuid_v7() {
                make_test("insert-call-uuid-v7").run();
            }

            #[test]
            fn insert_uuid() {
                make_test("insert-uuid").run();
            }

            #[test]
            fn delete_uuid() {
                make_test("delete-uuid").run();
            }

            #[test]
            fn update_uuid() {
                make_test("delete-uuid").run();
            }

            #[test]
            fn on_reducer() {
                make_test("on-reducer").run();
            }

            #[test]
            fn fail_reducer() {
                make_test("fail-reducer").run();
            }

            #[test]
            fn insert_vec() {
                make_test("insert-vec").run();
            }

            #[test]
            fn insert_option_some() {
                make_test("insert-option-some").run();
            }

            #[test]
            fn insert_option_none() {
                make_test("insert-option-none").run();
            }

            #[test]
            fn insert_struct() {
                make_test("insert-struct").run();
            }

            #[test]
            fn insert_simple_enum() {
                make_test("insert-simple-enum").run();
            }

            #[test]
            fn insert_enum_with_payload() {
                make_test("insert-enum-with-payload").run();
            }

            #[test]
            fn insert_delete_large_table() {
                make_test("insert-delete-large-table").run();
            }

            #[test]
            fn insert_primitives_as_strings() {
                make_test("insert-primitives-as-strings").run();
            }

            // #[test]
            // fn resubscribe() {
            //     make_test("resubscribe").run();
            // }

            #[test]
            #[should_panic]
            fn should_fail() {
                make_test("should-fail").run();
            }

            #[test]
            fn reauth() {
                make_test("reauth-part-1").run();
                make_test("reauth-part-2").run();
            }

            #[test]
            fn reconnect_different_connection_id() {
                make_test("reconnect-different-connection-id").run();
            }

            #[test]
            fn connect_disconnect_callbacks() {
                const CONNECT_DISCONNECT_CLIENT: &str =
                    concat!(env!("CARGO_MANIFEST_DIR"), "/tests/connect_disconnect_client");

                super::platform_test_builder(CONNECT_DISCONNECT_CLIENT, None)
                    .with_name(concat!("connect-disconnect-callback-", stringify!($lang)))
                    .with_module(concat!("sdk-test-connect-disconnect", $suffix))
                    .with_language("rust")
                    // We test against multiple modules in different languages,
                    // and as of writing (pgoldman 2026-02-12),
                    // some of those languages have not yet been updated to make scheduled and lifecycle reducers
                    // private by default. As such, generating only public items results in different bindings
                    // depending on which module is the source.
                    .with_generate_private_items(true)
                    .with_bindings_dir("src/module_bindings")
                    .build()
                    .run();
            }

            #[test]
            fn caller_always_notified() {
                make_test("caller-always-notified").run();
            }

            #[test]
            // This test is currently broken due to our use of `with_generate_private_items(true)`.
            // Codegen will include private tables in the list of all tables,
            // meaning `subscribe_to_all_tables` will attempt to subscribe to private tables,
            // which will fail due to the client not being privileged.
            // TODO: once all modules are updated for `RawModuleDefV10`, disable generating private items in `make_test`,
            // and re-enable this test.
            // Alternatively, either split this test out into a separate module/client pair which runs only against V10 modules,
            // or mark every table in the `sdk-test` family of modules `public`.
            #[should_panic]
            fn subscribe_all_select_star() {
                make_test("subscribe-all-select-star").run();
            }

            #[test]
            fn caller_alice_receives_reducer_callback_but_not_bob() {
                make_test("caller-alice-receives-reducer-callback-but-not-bob").run();
            }

            #[test]
            fn row_deduplication() {
                make_test("row-deduplication").run();
            }

            #[test]
            fn row_deduplication_join_r_and_s() {
                make_test("row-deduplication-join-r-and-s").run();
            }

            #[test]
            fn row_deduplication_r_join_s_and_r_join_t8() {
                make_test("row-deduplication-r-join-s-and-r-joint").run();
            }

            #[test]
            fn test_lhs_join_update() {
                make_test("test-lhs-join-update").run()
            }

            #[test]
            fn test_lhs_join_update_disjoint_queries() {
                make_test("test-lhs-join-update-disjoint-queries").run()
            }

            // The Rust client variant of this test is currently under-synchronized:
            // it returns basically instantly after starting the connection.
            // It's also somewhat broken due to casing issues.
            // Re-enable this test once it is fixed and properly waiting for its results.
            #[test]
            #[ignore = "Flaky until test-client retains ignored connections or this test owns its connection lifetime"]
            fn test_intra_query_bag_semantics_for_join() {
                make_test("test-intra-query-bag-semantics-for-join").run()
            }

            #[test]
            fn two_different_compression_algos() {
                make_test("two-different-compression-algos").run();
            }

            #[test]
            fn test_parameterized_subscription() {
                make_test("test-parameterized-subscription").run();
            }

            #[test]
            fn test_rls_subscription() {
                make_test("test-rls-subscription").run()
            }

            #[test]
            fn pk_simple_enum() {
                make_test("pk-simple-enum").run();
            }

            #[test]
            fn indexed_simple_enum() {
                make_test("indexed-simple-enum").run();
            }

            #[test]
            fn overlapping_subscriptions() {
                make_test("overlapping-subscriptions").run();
            }

            #[test]
            fn sorted_uuids_insert() {
                make_test("sorted-uuids-insert").run();
            }
        }
    };
}

declare_tests_with_suffix!(rust, "");
declare_tests_with_suffix!(typescript, "-ts");
// TODO: migrate csharp to snake_case table names
declare_tests_with_suffix!(csharp, "-cs");
declare_tests_with_suffix!(cpp, "-cpp");

/// Tests of event table functionality, using <./event-table-client> and <../../../modules/sdk-test>.
///
/// These are separate from the existing client because as of writing (2026-02-07),
/// we do not have event table support in all of the module languages we have tested.
mod event_table_tests {
    use spacetimedb_testing::sdk::Test;

    const MODULE: &str = "sdk-test-event-table";
    const CLIENT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/event-table-client");

    fn make_test(subcommand: &str) -> Test {
        super::platform_test_builder(CLIENT, Some(subcommand))
            .with_name(subcommand)
            .with_module(MODULE)
            .with_language("rust")
            .with_bindings_dir("src/module_bindings")
            .build()
    }

    #[test]
    fn event_table() {
        make_test("event-table").run();
    }

    #[test]
    fn multiple_events() {
        make_test("multiple-events").run();
    }

    #[test]
    fn events_dont_persist() {
        make_test("events-dont-persist").run();
    }
}

macro_rules! procedure_tests {
    ($mod_name:ident, $suffix:literal) => {
        mod $mod_name {
            //! Tests of procedure functionality, using <./procedure_client> and <../../../modules/sdk-test-procedure>.
            //!
            //! These are separate from the existing client and module because as of writing (pgoldman 2025-10-30),
            //! we do not have procedure support in all of the module languages we have tested.

            use spacetimedb_testing::sdk::Test;

            const MODULE: &str = concat!("sdk-test-procedure", $suffix);
            const CLIENT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/procedure-client");

            fn make_test(subcommand: &str) -> Test {
                super::platform_test_builder(CLIENT, Some(subcommand))
                    .with_name(subcommand)
                    .with_module(MODULE)
                    .with_language("rust")
                    // We test against multiple modules in different languages,
                    // and as of writing (pgoldman 2026-02-12),
                    // some of those languages have not yet been updated to make scheduled and lifecycle reducers
                    // private by default. As such, generating only public items results in different bindings
                    // depending on which module is the source.
                    .with_generate_private_items(true)
                    .with_bindings_dir("src/module_bindings")
                    .build()
            }

            #[test]
            fn return_values() {
                make_test("procedure-return-values").run()
            }

            #[test]
            fn observe_panic() {
                make_test("procedure-observe-panic").run()
            }

            #[test]
            fn with_tx_commit() {
                make_test("insert-with-tx-commit").run()
            }

            #[test]
            fn with_tx_rollback() {
                make_test("insert-with-tx-rollback").run()
            }

            #[test]
            fn http_ok() {
                make_test("procedure-http-ok").run()
            }

            #[test]
            fn http_err() {
                make_test("procedure-http-err").run()
            }

            #[test]
            fn schedule_procedure() {
                make_test("schedule-procedure").run()
            }
        }
    };
}

procedure_tests!(rust_procedures, "");
procedure_tests!(typescript_procedures, "-ts");
procedure_tests!(cpp_procedures, "-cpp");
procedure_tests!(csharp_procedures, "-cs");

macro_rules! view_tests {
    ($mod_name:ident, $suffix:literal) => {
        mod $mod_name {
            use spacetimedb_testing::sdk::Test;

            const MODULE: &str = concat!("sdk-test-view", $suffix);
            const CLIENT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/view-client");

            fn make_test(subcommand: &str) -> Test {
                super::platform_test_builder(CLIENT, Some(subcommand))
                    .with_name(subcommand)
                    .with_module(MODULE)
                    .with_language("rust")
                    // We test against multiple modules in different languages,
                    // and as of writing (pgoldman 2026-02-12),
                    // some of those languages have not yet been updated to make scheduled and lifecycle reducers
                    // private by default. As such, generating only public items results in different bindings
                    // depending on which module is the source.
                    .with_generate_private_items(true)
                    .with_bindings_dir("src/module_bindings")
                    .build()
            }

            #[test]
            fn subscribe_anonymous_view() {
                make_test("view-anonymous-subscribe").run()
            }

            #[test]
            fn subscribe_anonymous_view_query_builder() {
                make_test("view-anonymous-subscribe-with-query-builder").run()
            }

            #[test]
            fn subscribe_non_anonymous_view() {
                make_test("view-non-anonymous-subscribe").run()
            }

            #[test]
            fn subscribe_view_non_table_return() {
                make_test("view-non-table-return").run()
            }

            #[test]
            fn subscribe_view_non_table_query_builder_return() {
                make_test("view-non-table-query-builder-return").run()
            }

            #[test]
            fn subscription_updates_for_view() {
                make_test("view-subscription-update").run()
            }

            #[test]
            fn disconnect_does_not_break_sender_view_updates() {
                make_test("view-disconnect-does-not-break-sender-updates").run()
            }
        }
    };
}

view_tests!(rust_view, "");
//view_tests!(cpp_view, "-cpp");

mod case_conversion_ts {
    use spacetimedb_testing::sdk::Test;

    const MODULE: &str = "sdk-test-case-conversion-ts";
    const CLIENT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/case-conversion-client");

    fn make_test(subcommand: &str) -> Test {
        Test::builder()
            .with_name(subcommand)
            .with_module(MODULE)
            .with_client(CLIENT)
            .with_language("rust")
            .with_bindings_dir("src/module_bindings")
            .with_compile_command("cargo build")
            .with_run_command(format!("cargo run -- {}", subcommand))
            .build()
    }

    #[test]
    fn insert_player() {
        make_test("insert-player").run();
    }

    #[test]
    fn insert_person() {
        make_test("insert-person").run();
    }

    #[test]
    fn ban_player() {
        make_test("ban-player").run();
    }

    #[test]
    fn query_builder_filter() {
        make_test("query-builder-filter").run();
    }

    #[test]
    fn query_builder_join() {
        make_test("query-builder-join").run();
    }

    #[test]
    fn query_view() {
        make_test("view").run();
    }
}

mod case_conversion_rust {
    use spacetimedb_testing::sdk::Test;

    const MODULE: &str = "sdk-test-case-conversion";
    const CLIENT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/case-conversion-client");

    fn make_test(subcommand: &str) -> Test {
        Test::builder()
            .with_name(subcommand)
            .with_module(MODULE)
            .with_client(CLIENT)
            .with_language("rust")
            .with_bindings_dir("src/module_bindings")
            .with_compile_command("cargo build")
            .with_run_command(format!("cargo run -- {}", subcommand))
            .build()
    }

    #[test]
    fn insert_player() {
        make_test("insert-player").run();
    }

    #[test]
    fn insert_person() {
        make_test("insert-person").run();
    }

    #[test]
    fn ban_player() {
        make_test("ban-player").run();
    }

    #[test]
    fn query_builder_filter() {
        make_test("query-builder-filter").run();
    }

    #[test]
    fn query_builder_join() {
        make_test("query-builder-join").run();
    }

    #[test]
    fn query_view() {
        make_test("view").run();
    }
}
/// Tests of case conversion using a TypeScript client against the Rust module `sdk-test-case-conversion`.
///
/// Uses the TS client at `crates/bindings-typescript/case-conversion-test-client`.
/// Verifies that the TypeScript SDK correctly handles case-converted names from a Rust module:
/// - Table accessors, field names with digit boundaries, nested structs, enum variants
/// - Reducers with explicit names, query builder filters and joins
mod case_conversion_rust_ts_client {
    use spacetimedb_testing::sdk::Test;

    const MODULE: &str = "sdk-test-case-conversion";
    const CLIENT: &str = concat!(
        env!("CARGO_MANIFEST_DIR"),
        "/../../crates/bindings-typescript/case-conversion-test-client"
    );

    fn make_test(subcommand: &str) -> Test {
        Test::builder()
            .with_name(subcommand)
            .with_module(MODULE)
            .with_client(CLIENT)
            .with_language("typescript")
            .with_bindings_dir("src/module_bindings")
            .with_compile_command(
                "sh -c 'pnpm install && pnpm --dir .. run build && pnpm exec prettier --write src/module_bindings && pnpm run build'",
            )
            .with_run_command(format!("node dist/index.js {}", subcommand))
            .build()
    }

    #[test]
    fn insert_player() {
        make_test("insert-player").run();
    }

    #[test]
    fn insert_person() {
        make_test("insert-person").run();
    }

    #[test]
    fn ban_player() {
        make_test("ban-player").run();
    }

    #[test]
    fn query_builder_filter() {
        make_test("query-builder-filter").run();
    }

    #[test]
    fn query_builder_join() {
        make_test("query-builder-join").run();
    }
}

view_tests!(cpp_view, "-cpp");

macro_rules! view_pk_tests {
    ($mod_name:ident, $suffix:literal) => {
        mod $mod_name {
            use spacetimedb_testing::sdk::Test;

            const MODULE: &str = concat!("sdk-test-view-pk", $suffix);
            const CLIENT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/view-pk-client");

            fn make_test(subcommand: &str) -> Test {
                super::platform_test_builder(CLIENT, Some(subcommand))
                    .with_name(subcommand)
                    .with_module(MODULE)
                    .with_language("rust")
                    .with_bindings_dir("src/module_bindings")
                    .build()
            }

            #[test]
            fn query_builder_view_with_pk_on_update_callback() {
                make_test("view-pk-on-update").run()
            }

            #[test]
            fn query_builder_join_table_with_view_pk() {
                make_test("view-pk-join-query-builder").run()
            }

            #[test]
            fn query_builder_semijoin_two_sender_views_with_pk() {
                make_test("view-pk-semijoin-two-sender-views-query-builder").run()
            }
        }
    };
}

view_pk_tests!(rust_view_pk, "");
view_pk_tests!(csharp_view_pk, "-cs");