switchy_database 0.3.0

Switchy database package
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
use chrono::{NaiveDateTime, Utc};
use std::sync::Arc;
use switchy_database::{Database, DatabaseValue};

/// Comprehensive datetime test suite trait for cross-backend testing
#[allow(unused)]
pub trait DateTimeTestSuite<I: Into<String>> {
    type DatabaseType: Database + Send + Sync;

    /// Get database instance for testing (returns None if unavailable)
    async fn get_database(&self) -> Option<Arc<Self::DatabaseType>>;

    fn gen_param(&self, i: u8) -> I;

    /// Generate a unique suffix for this test run
    fn get_unique_suffix(&self) -> String {
        let nanos = std::time::SystemTime::now()
            .duration_since(std::time::UNIX_EPOCH)
            .unwrap()
            .as_nanos();
        (nanos % 1_000_000_000).to_string()
    }

    /// Get the full table name for a specific test
    fn get_table_name(&self, test_name: &str, backend: &str) -> String {
        format!(
            "{backend}_datetime_{test_name}_{}",
            self.get_unique_suffix()
        )
    }

    /// Create test table with datetime columns (backend-specific implementation)
    async fn create_test_table(&self, db: &Self::DatabaseType, table_name: &str);

    /// Clean up test data (backend-specific implementation)
    async fn cleanup_test_data(&self, db: &Self::DatabaseType, table_name: &str);

    /// Extract timestamp from database row (backend-specific implementation)
    async fn get_timestamp_column(
        &self,
        db: &Self::DatabaseType,
        table_name: &str,
        column: &str,
        id: i32,
    ) -> Option<NaiveDateTime>;

    /// Get the ID of an inserted row by description (backend-specific implementation)
    async fn get_row_id_by_description(
        &self,
        db: &Self::DatabaseType,
        table_name: &str,
        description: &str,
    ) -> i32;

    /// Helper to verify timestamp is within expected range
    fn assert_timestamp_near(
        &self,
        actual: NaiveDateTime,
        expected: NaiveDateTime,
        tolerance_mins: i64,
    ) {
        let diff = (actual - expected).num_seconds().abs();
        assert!(
            diff <= tolerance_mins * 60,
            "Timestamp {actual} not within {tolerance_mins}m of {expected} (diff: {diff}s)"
        );
    }

    // ===== ABSTRACT TEST METHODS =====

    /// Test basic NOW() insertion functionality
    async fn test_now_insert(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_insert", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Insert row with NOW()
        self.insert_with_now(&db, &table_name, "test now insert")
            .await;

        let after = Utc::now().naive_utc();

        // Query it back and verify timestamp is within reasonable range
        let id = self
            .get_row_id_by_description(&db, &table_name, "test now insert")
            .await;
        let created_at = self
            .get_timestamp_column(&db, &table_name, "created_at", id)
            .await
            .expect("Failed to get created_at timestamp");

        // Should be within 5 seconds of when we started the test
        self.assert_timestamp_near(created_at, before, 5);
        self.assert_timestamp_near(created_at, after, 5);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() in WHERE clause conditions
    async fn test_now_in_where_clause(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_where", backend);
        self.create_test_table(&db, &table_name).await;

        // Insert row with future expiry (NOW + 1 day)
        self.insert_with_expires_at(
            &db,
            &table_name,
            DatabaseValue::now().plus_days(1).build(),
            "future expiry",
        )
        .await;

        // Insert row with past expiry (NOW - 1 day)
        self.insert_with_expires_at(
            &db,
            &table_name,
            DatabaseValue::now().minus_days(1).build(),
            "past expiry",
        )
        .await;

        // Query WHERE expires_at > NOW() - should only return future row
        let future_rows = db
            .query_raw_params(
                &format!(
                    "SELECT * FROM {} WHERE expires_at > {}",
                    table_name,
                    self.gen_param(1).into()
                ),
                &[DatabaseValue::Now],
            )
            .await
            .expect("Failed to query future rows");

        assert_eq!(
            future_rows.len(),
            1,
            "Should find exactly 1 row with future expiry"
        );

        // Query WHERE expires_at < NOW() - should only return past row
        let past_rows = db
            .query_raw_params(
                &format!(
                    "SELECT * FROM {} WHERE expires_at < {}",
                    table_name,
                    self.gen_param(1).into()
                ),
                &[DatabaseValue::Now],
            )
            .await
            .expect("Failed to query past rows");

        assert_eq!(
            past_rows.len(),
            1,
            "Should find exactly 1 row with past expiry"
        );

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() with interval arithmetic
    async fn test_now_plus_interval(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_plus", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Insert row with NOW() + 1 hour
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().plus_hours(1).build(),
            "scheduled future",
        )
        .await;

        // Query it back and verify timestamp is ~1 hour in future
        let id = self
            .get_row_id_by_description(&db, &table_name, "scheduled future")
            .await;
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for timestamp");

        // Should be about 1 hour after test start (within 5 seconds tolerance)
        let expected_time = before + chrono::Duration::hours(1);
        self.assert_timestamp_near(scheduled_for, expected_time, 5);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() with negative interval (past times)
    async fn test_now_minus_interval(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_minus", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Insert row with NOW() - 30 minutes
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().minus_minutes(30).build(),
            "scheduled past",
        )
        .await;

        // Query it back and verify timestamp is ~30 minutes in past
        let id = self
            .get_row_id_by_description(&db, &table_name, "scheduled past")
            .await;
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for timestamp");

        // Should be about 30 minutes before test start (within 5 seconds tolerance)
        let expected_time = before - chrono::Duration::minutes(30);
        self.assert_timestamp_near(scheduled_for, expected_time, 5);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test complex interval combinations
    async fn test_complex_interval_operations(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("complex_interval", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Create complex time: NOW() + 1 day + 2 hours - 15 minutes
        let complex_future = DatabaseValue::now()
            .plus_days(1)
            .plus_hours(2)
            .minus_minutes(15);

        self.insert_with_scheduled_for(&db, &table_name, complex_future.build(), "complex future")
            .await;

        // Query it back and verify the complex calculation
        let id = self
            .get_row_id_by_description(&db, &table_name, "complex future")
            .await;
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for timestamp");

        // Calculate expected time: +1 day +2 hours -15 minutes
        let expected_time = before + chrono::Duration::days(1) + chrono::Duration::hours(2)
            - chrono::Duration::minutes(15);

        self.assert_timestamp_near(scheduled_for, expected_time, 5);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test UPDATE with NOW() values
    async fn test_update_with_now(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("update_now", backend);
        self.create_test_table(&db, &table_name).await;

        // Insert initial row with fixed timestamp
        let initial_time = Utc::now().naive_utc() - chrono::Duration::hours(1);
        self.insert_with_expires_at(
            &db,
            &table_name,
            DatabaseValue::DateTime(initial_time),
            "update test",
        )
        .await;

        let before_update = Utc::now().naive_utc();

        // Update with NOW()
        let id = self
            .get_row_id_by_description(&db, &table_name, "update test")
            .await;
        db.exec_raw_params(
            &format!(
                "UPDATE {} SET expires_at = {} WHERE id = {}",
                table_name,
                self.gen_param(1).into(),
                self.gen_param(2).into()
            ),
            &[DatabaseValue::Now, DatabaseValue::Int64(id as i64)],
        )
        .await
        .expect("Failed to update with NOW()");

        let after_update = Utc::now().naive_utc();

        // Verify the timestamp was updated to NOW()
        let updated_expires_at = self
            .get_timestamp_column(&db, &table_name, "expires_at", id)
            .await
            .expect("Failed to get updated expires_at timestamp");

        // Should be within 5 seconds of the update time
        self.assert_timestamp_near(updated_expires_at, before_update, 5);
        self.assert_timestamp_near(updated_expires_at, after_update, 5);

        // Should NOT be the initial time
        assert!(
            (updated_expires_at - initial_time).num_seconds().abs() > 3000, // > 50 minutes
            "Updated timestamp should be much different from initial time"
        );

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test multiple NOW() values in same query are consistent
    async fn test_multiple_now_consistency(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("multiple_now", backend);
        self.create_test_table(&db, &table_name).await;

        // Insert with multiple NOW() values in same query
        db.exec_raw_params(
            &format!(
                "INSERT INTO {} (created_at, expires_at, scheduled_for, description) VALUES ({}, {}, {}, {})",
                table_name,
                self.gen_param(1).into(),
                self.gen_param(2).into(),
                self.gen_param(3).into(),
                self.gen_param(4).into()
            ),
            &[
                DatabaseValue::Now,
                DatabaseValue::Now,
                DatabaseValue::Now,
                DatabaseValue::String("consistency test".to_string()),
            ],
        )
        .await
        .expect("Failed to insert with multiple NOW() values");

        // Get the inserted row
        let id = self
            .get_row_id_by_description(&db, &table_name, "consistency test")
            .await;

        let created_at = self
            .get_timestamp_column(&db, &table_name, "created_at", id)
            .await
            .expect("Failed to get created_at");
        let expires_at = self
            .get_timestamp_column(&db, &table_name, "expires_at", id)
            .await
            .expect("Failed to get expires_at");
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for");

        // All three timestamps should be very close (within 1 second)
        self.assert_timestamp_near(created_at, expires_at, 1);
        self.assert_timestamp_near(created_at, scheduled_for, 1);
        self.assert_timestamp_near(expires_at, scheduled_for, 1);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test mixed NOW() and NowPlus in complex operations
    async fn test_mixed_now_operations(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("mixed_now", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Complex query mixing NOW() and NowPlus
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().plus_minutes(30).build(),
            "mixed operations test",
        )
        .await;

        // Query it back
        let id = self
            .get_row_id_by_description(&db, &table_name, "mixed operations test")
            .await;
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for timestamp");

        // Should be about 30 minutes in future
        let expected_time = before + chrono::Duration::minutes(30);
        self.assert_timestamp_near(scheduled_for, expected_time, 5);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    // ===== ADDITIONAL TEST METHODS =====

    /// Test NOW() + days
    async fn test_now_plus_days(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_plus_days", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Insert with NOW() + 1 day
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().plus_days(1).build(),
            "plus one day",
        )
        .await;

        // Query it back
        let id = self
            .get_row_id_by_description(&db, &table_name, "plus one day")
            .await;
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for timestamp");

        // Should be about 1 day in future
        let expected_time = before + chrono::Duration::days(1);
        self.assert_timestamp_near(scheduled_for, expected_time, 10);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() - days
    async fn test_now_minus_days(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_minus_days", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Insert with NOW() - 1 day
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().minus_days(1).build(),
            "minus one day",
        )
        .await;

        // Query it back
        let id = self
            .get_row_id_by_description(&db, &table_name, "minus one day")
            .await;
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for timestamp");

        // Should be about 1 day in past
        let expected_time = before - chrono::Duration::days(1);
        self.assert_timestamp_near(scheduled_for, expected_time, 10);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() + hours/minutes/seconds
    async fn test_now_plus_hours_minutes_seconds(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_plus_hours_minutes_seconds", backend);
        self.create_test_table(&db, &table_name).await;

        // Test with hours, minutes, seconds
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now()
                .plus_hours(2)
                .plus_minutes(30)
                .plus_seconds(15)
                .build(),
            "complex time",
        )
        .await;

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() + minutes with normalization
    async fn test_now_plus_minutes_normalization(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_plus_minutes_normalization", backend);
        self.create_test_table(&db, &table_name).await;

        // Test with large minutes that should normalize to hours
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().plus_minutes(90).build(),
            "normalized time",
        )
        .await;

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() + complex interval
    async fn test_now_plus_complex_interval(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_plus_complex_interval", backend);
        self.create_test_table(&db, &table_name).await;

        // Create complex time: NOW() + 1 day + 2 hours - 15 minutes
        let complex_future = DatabaseValue::now()
            .plus_days(1)
            .plus_hours(2)
            .minus_minutes(15);

        self.insert_with_scheduled_for(&db, &table_name, complex_future.build(), "complex future")
            .await;

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test zero interval returns NOW()
    async fn test_zero_interval_returns_now(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("zero_interval_returns_now", backend);
        self.create_test_table(&db, &table_name).await;

        let before = Utc::now().naive_utc();

        // Insert with zero interval (should be same as NOW)
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().build(),
            "zero interval",
        )
        .await;

        let after = Utc::now().naive_utc();

        // Should be within reasonable range of NOW
        let id = self
            .get_row_id_by_description(&db, &table_name, "zero interval")
            .await;
        let scheduled_for = self
            .get_timestamp_column(&db, &table_name, "scheduled_for", id)
            .await
            .expect("Failed to get scheduled_for timestamp");

        self.assert_timestamp_near(scheduled_for, before, 5);
        self.assert_timestamp_near(scheduled_for, after, 5);

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test mixed parameters
    async fn test_mixed_parameters(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("mixed_parameters", backend);
        self.create_test_table(&db, &table_name).await;

        // Test mixed NOW() and interval operations
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now().plus_minutes(30).build(),
            "mixed operations test",
        )
        .await;

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test NOW() consistency in transaction
    async fn test_now_consistency_in_transaction(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("now_consistency_in_transaction", backend);
        self.create_test_table(&db, &table_name).await;

        // Insert multiple rows with NOW() - should all have same timestamp within transaction
        self.insert_with_all_timestamps(
            &db,
            &table_name,
            DatabaseValue::Now,
            DatabaseValue::Now,
            DatabaseValue::Now,
            "consistent timestamps",
        )
        .await;

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    /// Test duration conversion
    async fn test_duration_conversion(&self, backend: &str) {
        let Some(db) = self.get_database().await else {
            println!("Skipping test - database not available");
            return;
        };

        let table_name = self.get_table_name("duration_conversion", backend);
        self.create_test_table(&db, &table_name).await;

        // Test various duration formats
        self.insert_with_scheduled_for(
            &db,
            &table_name,
            DatabaseValue::now()
                .plus_days(1)
                .plus_hours(1)
                .plus_minutes(1)
                .build(),
            "duration test",
        )
        .await;

        // Cleanup
        self.cleanup_test_data(&db, &table_name).await;
    }

    // ===== HELPER METHODS (backend-specific) =====

    /// Insert row with NOW() as created_at
    async fn insert_with_now(&self, db: &Self::DatabaseType, table_name: &str, description: &str);

    /// Insert row with specific expires_at value
    async fn insert_with_expires_at(
        &self,
        db: &Self::DatabaseType,
        table_name: &str,
        expires_at: DatabaseValue,
        description: &str,
    );

    /// Insert row with specific scheduled_for value
    async fn insert_with_scheduled_for(
        &self,
        db: &Self::DatabaseType,
        table_name: &str,
        scheduled_for: DatabaseValue,
        description: &str,
    );

    /// Insert row with all timestamp values
    async fn insert_with_all_timestamps(
        &self,
        db: &Self::DatabaseType,
        table_name: &str,
        created_at: DatabaseValue,
        expires_at: DatabaseValue,
        scheduled_for: DatabaseValue,
        description: &str,
    );
}