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
//! Warnings generator for Introspection

use std::{collections::BTreeSet, fmt};

/// A group of warnings that can be grouped by a key, which depends on the concretely
/// instantiated type T.
struct GroupBy<'a, T>(&'a Vec<T>);

impl fmt::Display for GroupBy<'_, ModelAndField> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        display_list(self.0, "Model", |mf| &mf.model, |mf| &mf.field, f)
    }
}

impl fmt::Display for GroupBy<'_, ViewAndField> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        display_list(self.0, "View", |vf| &vf.view, |vf| &vf.field, f)
    }
}

impl fmt::Display for GroupBy<'_, TypeAndField> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        display_list(self.0, "Composite type", |cf| &cf.composite_type, |cf| &cf.field, f)
    }
}

fn display_list<T: Ord>(
    items: &[T],
    group_name: &str,
    project_key: fn(&T) -> &str,
    project_field: fn(&T) -> &str,
    f: &mut fmt::Formatter<'_>,
) -> fmt::Result {
    let sorted: BTreeSet<_> = items.iter().collect();
    let mut sorted = sorted.into_iter().peekable();
    let mut key = None;
    let close = |f: &mut fmt::Formatter<'_>| f.write_str("]\n");

    while let Some(next) = sorted.next() {
        if Some(project_key(next)) != key {
            write!(f, r#"  - {group_name}: "{}", field(s): ["#, project_key(next))?;
            key = Some(project_key(next));
        }

        write!(f, r#""{}""#, project_field(next))?;
        match sorted.peek() {
            Some(vf) if Some(project_key(vf)) != key => close(f)?,
            None => close(f)?,
            Some(_) => f.write_str(", ")?,
        }
    }
    Ok(())
}

/// Collections used for warning generation. These should be preferred
/// over directly creating warnings from the code, to prevent spamming
/// the user.
#[derive(Debug, Default, PartialEq)]
pub struct Warnings {
    /// Fields having an empty name.
    pub fields_with_empty_names_in_model: Vec<ModelAndField>,
    /// Fields having an empty name.
    pub fields_with_empty_names_in_view: Vec<ViewAndField>,
    /// Fields having an empty name.
    pub fields_with_empty_names_in_type: Vec<TypeAndField>,
    /// Field names in models we remapped during introspection.
    pub remapped_fields_in_model: Vec<ModelAndField>,
    /// Field names in views we remapped during introspection.
    pub remapped_fields_in_view: Vec<ViewAndField>,
    /// Enum values that are empty strings.
    pub enum_values_with_empty_names: Vec<EnumAndValue>,
    /// Models that have no fields.
    pub models_without_columns: Vec<Model>,
    /// Models missing a id or unique constraint.
    pub models_without_identifiers: Vec<Model>,
    /// Views missing a id or unique constraint.
    pub views_without_identifiers: Vec<View>,
    /// If the id attribute has a name taken from a previous model.
    pub reintrospected_id_names_in_model: Vec<Model>,
    /// If the id attribute has a name taken from a previous view.
    pub reintrospected_id_names_in_view: Vec<View>,
    /// The field in model has a type we do not currently support in Prisma.
    pub unsupported_types_in_model: Vec<ModelAndFieldAndType>,
    /// The field in view has a type we do not currently support in Prisma.
    pub unsupported_types_in_view: Vec<ViewAndFieldAndType>,
    /// The field in the composite type has a type we do not currently support in Prisma.
    pub unsupported_types_in_type: Vec<TypeAndFieldAndType>,
    /// The name of the model is taken from a previous data model.
    pub remapped_models: Vec<Model>,
    /// The name of the view is taken from a previous data model.
    pub remapped_views: Vec<View>,
    /// The name of the enum variant is taken from a previous data model.
    pub remapped_values: Vec<EnumAndValue>,
    /// The name of the enum is taken from a previous data model.
    pub remapped_enums: Vec<Enum>,
    /// The relation is copied from a previous data model, only if
    /// `relationMode` is `prisma`.
    pub reintrospected_relations: Vec<Model>,
    /// The name of these models or enums was a dupe in the PSL.
    pub duplicate_names: Vec<TopLevelItem>,
    /// Warn about using partition tables, which only have introspection support.
    pub partition_tables: Vec<Model>,
    /// Warn about using inherited tables, which only have introspection support.
    pub inherited_tables: Vec<Model>,
    /// Warn about non-default NULLS FIRST/NULLS LAST in indices.
    pub non_default_index_null_sort_order: Vec<IndexedColumn>,
    /// Warn about using row level security, which is currently unsupported.
    pub row_level_security_tables: Vec<Model>,
    /// Warn about check constraints.
    pub check_constraints: Vec<ModelAndConstraint>,
    /// Warn about exclusion constraints.
    pub exclusion_constraints: Vec<ModelAndConstraint>,
    /// Warn about row level TTL
    pub row_level_ttl: Vec<Model>,
    /// Warn about non-default unique deferring setup
    pub non_default_deferring: Vec<ModelAndConstraint>,
    /// Warning about Expression Indexes.
    pub expression_indexes: Vec<ModelAndConstraint>,
    /// Warn about comments
    pub objects_with_comments: Vec<Object>,
    /// Warn about fields which point to an empty type.
    pub model_fields_pointing_to_an_empty_type: Vec<ModelAndField>,
    /// Warn about compositefields which point to an empty type.
    pub type_fields_pointing_to_an_empty_type: Vec<TypeAndField>,
    /// Warn about unknown types in a model.
    pub model_fields_with_unknown_type: Vec<ModelAndField>,
    /// Warn about unknown types in a composite type.
    pub type_fields_with_unknown_type: Vec<TypeAndField>,
    /// Warn about undecided types in a model.
    pub undecided_types_in_models: Vec<ModelAndFieldAndType>,
    /// Warn about undecided types in a composite type.
    pub undecided_types_in_types: Vec<TypeAndFieldAndType>,
    /// Warning about JSONSchema on a model.
    pub json_schema_defined: Vec<Model>,
    /// Warning about JSONSchema on a model.
    pub capped_collection: Vec<Model>,
}

impl Warnings {
    /// Generate a new empty warnings structure.
    pub fn new() -> Self {
        Self::default()
    }

    /// True if we have no warnings
    pub fn is_empty(&self) -> bool {
        self == &Self::default()
    }
}

impl fmt::Display for Warnings {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.write_str("*** WARNING ***\n")?;

        fn render_warnings<T>(msg: &str, items: &[T], f: &mut fmt::Formatter<'_>) -> fmt::Result
        where
            T: fmt::Display,
        {
            if !items.is_empty() {
                writeln!(f)?;
                f.write_str(msg)?;
                writeln!(f)?;

                for item in items {
                    writeln!(f, "  - {item}")?;
                }
            }

            Ok(())
        }

        fn render_warnings_grouped<'a, T>(msg: &str, items: &'a Vec<T>, f: &mut fmt::Formatter<'_>) -> fmt::Result
        where
            GroupBy<'a, T>: fmt::Display,
        {
            if items.is_empty() {
                return Ok(());
            }

            f.write_str("\n")?;
            f.write_str(msg)?;
            f.write_str("\n")?;
            fmt::Display::fmt(&GroupBy(items), f)
        }

        render_warnings_grouped(
            "These fields were commented out because their names are currently not supported by Prisma. Please provide valid ones that match [a-zA-Z][a-zA-Z0-9_]* using the `@map` attribute:",
            &self.fields_with_empty_names_in_model,
            f
        )?;

        render_warnings_grouped(
            "These fields were commented out because their names are currently not supported by Prisma. Please provide valid ones that match [a-zA-Z][a-zA-Z0-9_]* using the `@map` attribute:",
            &self.fields_with_empty_names_in_view,
            f
        )?;

        render_warnings_grouped(
            "These fields were commented out because their names are currently not supported by Prisma. Please provide valid ones that match [a-zA-Z][a-zA-Z0-9_]* using the `@map` attribute:",
            &self.fields_with_empty_names_in_type,
            f
        )?;

        render_warnings(
            "These fields were enriched with `@map` information taken from the previous Prisma schema:",
            &self.remapped_fields_in_model,
            f,
        )?;

        render_warnings(
            "These fields were enriched with `@map` information taken from the previous Prisma schema:",
            &self.remapped_fields_in_view,
            f,
        )?;

        render_warnings(
            "These enum values were commented out because their names are currently not supported by Prisma. Please provide valid ones that match [a-zA-Z][a-zA-Z0-9_]* using the `@map` attribute:",
            &self.enum_values_with_empty_names,
            f
        )?;

        render_warnings(
            "The following models were commented out as we could not retrieve columns for them. Please check your privileges:",
            &self.models_without_columns,
            f
        )?;

        render_warnings(
            "The following models were ignored as they do not have a valid unique identifier or id. This is currently not supported by Prisma Client:",
            &self.models_without_identifiers,
            f
        )?;

        render_warnings(
            "The following views were ignored as they do not have a valid unique identifier or id. This is currently not supported by Prisma Client. Please refer to the documentation on defining unique identifiers in views: https://pris.ly/d/view-identifiers",
            &self.views_without_identifiers,
            f
        )?;

        render_warnings(
            "These models were enriched with custom compound id names taken from the previous Prisma schema:",
            &self.reintrospected_id_names_in_model,
            f,
        )?;

        render_warnings(
            "These views were enriched with custom compound id names taken from the previous Prisma schema:",
            &self.reintrospected_id_names_in_view,
            f,
        )?;

        render_warnings(
            "These fields are not supported by Prisma Client, because Prisma currently does not support their types:",
            &self.unsupported_types_in_model,
            f,
        )?;

        render_warnings(
            "These fields are not supported by Prisma Client, because Prisma currently does not support their types:",
            &self.unsupported_types_in_view,
            f,
        )?;

        render_warnings(
            "These fields are not supported by Prisma Client, because Prisma currently does not support their types:",
            &self.unsupported_types_in_type,
            f,
        )?;

        render_warnings(
            "These models were enriched with `@@map` information taken from the previous Prisma schema:",
            &self.remapped_models,
            f,
        )?;

        render_warnings(
            "These views were enriched with `@@map` information taken from the previous Prisma schema:",
            &self.remapped_views,
            f,
        )?;

        render_warnings(
            "These enum values were enriched with `@map` information taken from the previous Prisma schema:",
            &self.remapped_values,
            f,
        )?;

        render_warnings(
            "These enums were enriched with `@@map` information taken from the previous Prisma schema:",
            &self.remapped_enums,
            f,
        )?;

        render_warnings(
            "Relations were copied from the previous data model due to not using foreign keys in the database. If any of the relation columns changed in the database, the relations might not be correct anymore:",
            &self.reintrospected_relations,
            f,
        )?;

        render_warnings(
            "These items were renamed due to their names being duplicates in the Prisma Schema Language:",
            &self.duplicate_names,
            f,
        )?;

        render_warnings(
            "These tables are partition tables, which are not yet fully supported:",
            &self.partition_tables,
            f,
        )?;

        render_warnings(
            "These tables are inherited tables, which are not yet fully supported:",
            &self.inherited_tables,
            f,
        )?;

        render_warnings(
            "These index columns are having a non-default null sort order, which is not yet fully supported. Read more: https://pris.ly/d/non-default-index-null-ordering",
            &self.non_default_index_null_sort_order,
            f,
        )?;

        render_warnings(
            "These tables contain row level security, which is not yet fully supported. Read more: https://pris.ly/d/row-level-security",
            &self.row_level_security_tables,
            f,
        )?;

        render_warnings(
            "These constraints are not supported by Prisma Client, because Prisma currently does not fully support check constraints. Read more: https://pris.ly/d/check-constraints",
            &self.check_constraints,
            f,
        )?;

        render_warnings(
            "These constraints are not supported by Prisma Client, because Prisma currently does not fully support exclusion constraints. Read more: https://pris.ly/d/exclusion-constraints",
            &self.exclusion_constraints,
            f,
        )?;

        render_warnings(
            "These models are using a row level TTL setting defined in the database, which is not yet fully supported. Read more: https://pris.ly/d/row-level-ttl",
            &self.row_level_ttl,
            f,
        )?;

        render_warnings(
            "These primary key, foreign key or unique constraints are using non-default deferring in the database, which is not yet fully supported. Read more: https://pris.ly/d/constraint-deferring",
            &self.non_default_deferring,
            f,
        )?;

        render_warnings(
            "These objects have comments defined in the database, which is not yet fully supported. Read more: https://pris.ly/d/database-comments",
            &self.objects_with_comments,
            f,
        )?;

        render_warnings(
            "The following fields point to nested objects without any data:",
            &self.model_fields_pointing_to_an_empty_type,
            f,
        )?;

        render_warnings(
            "The following fields point to nested objects without any data:",
            &self.type_fields_pointing_to_an_empty_type,
            f,
        )?;

        render_warnings(
            "Could not determine the types for the following fields:",
            &self.model_fields_with_unknown_type,
            f,
        )?;

        render_warnings(
            "Could not determine the types for the following fields:",
            &self.type_fields_with_unknown_type,
            f,
        )?;

        render_warnings(
            "The following fields had data stored in multiple types. Either use Json or normalize data to the wanted type:",
            &self.undecided_types_in_models,
            f,
        )?;

        render_warnings(
            "The following fields had data stored in multiple types. Either use Json or normalize data to the wanted type:",
            &self.undecided_types_in_types,
            f,
        )?;

        render_warnings(
            "The following models have a JSON Schema defined in the database, which is not yet fully supported. Read more: https://pris.ly/d/mongodb-json-schema",
            &self.json_schema_defined,
            f
        )?;

        render_warnings(
            "The following models are capped collections, which are not yet fully supported. Read more: https://pris.ly/d/mongodb-capped-collections",
            &self.capped_collection,
            f
        )?;

        render_warnings(
            "These indexes are not supported by Prisma Client, because Prisma currently does not fully support expression indexes. Read more: https://pris.ly/d/expression-indexes",
            &self.expression_indexes,
            f
        )?;

        Ok(())
    }
}

/// A model that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct Model {
    /// The name of the model
    pub model: String,
}

impl fmt::Display for Model {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#""{}""#, self.model)
    }
}

/// A view that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct View {
    /// The name of the view
    pub view: String,
}

impl fmt::Display for View {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#""{}""#, self.view)
    }
}

/// An enum that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct Enum {
    /// The name of the enum
    pub r#enum: String,
}

impl fmt::Display for Enum {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#""{}""#, self.r#enum)
    }
}

/// A field in a model that triggered a warning.
#[derive(PartialEq, Debug, PartialOrd, Ord, Eq)]
pub struct ModelAndField {
    /// The name of the model
    pub model: String,
    /// The name of the field
    pub field: String,
}

impl fmt::Display for ModelAndField {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"Model: "{}", field: "{}""#, self.model, self.field)
    }
}

/// A field in a type that triggered a warning.
#[derive(PartialEq, Debug, PartialOrd, Eq, Ord)]
pub struct TypeAndField {
    /// The name of the model
    pub composite_type: String,
    /// The name of the field
    pub field: String,
}

impl fmt::Display for TypeAndField {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(
            f,
            r#"Composite type: "{}", field: "{}""#,
            self.composite_type, self.field
        )
    }
}

/// A field in a view that triggered a warning.
#[derive(PartialEq, Debug, PartialOrd, Ord, Eq)]
pub struct ViewAndField {
    /// The name of the view
    pub view: String,
    /// The name of the field
    pub field: String,
}

impl fmt::Display for ViewAndField {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"View: "{}", field: "{}""#, self.view, self.field)
    }
}

/// An index in a model that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct ModelAndIndex {
    /// The name of the model
    pub model: String,
    /// The name of the index
    pub index_db_name: String,
}

impl fmt::Display for ModelAndIndex {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"Model: "{}", index: "{}""#, self.model, self.index_db_name)
    }
}

/// A constraint in a model that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct ModelAndConstraint {
    /// The name of the model
    pub model: String,
    /// The name of the constraint
    pub constraint: String,
}

impl fmt::Display for ModelAndConstraint {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"Model: "{}", constraint: "{}""#, self.model, self.constraint)
    }
}

/// A field type in a model that triggered a warning.
#[derive(PartialEq, Debug)]
pub struct ModelAndFieldAndType {
    /// The name of the model
    pub model: String,
    /// The name of the field
    pub field: String,
    /// The name of the type
    pub r#type: String,
}

impl fmt::Display for ModelAndFieldAndType {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(
            f,
            r#"Model: "{}", field: "{}", original data type: "{}""#,
            self.model, self.field, self.r#type
        )
    }
}

/// A field type in a view that triggered a warning.
#[derive(PartialEq, Debug)]
pub struct ViewAndFieldAndType {
    /// The name of the view
    pub view: String,
    /// The name of the field
    pub field: String,
    /// The name of the type
    pub r#type: String,
}

impl fmt::Display for ViewAndFieldAndType {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(
            f,
            r#"View: "{}", field: "{}", original data type: "{}""#,
            self.view, self.field, self.r#type
        )
    }
}

/// A field type in a type that triggered a warning.
#[derive(PartialEq, Debug)]
pub struct TypeAndFieldAndType {
    /// The name of the type
    pub composite_type: String,
    /// The name of the field
    pub field: String,
    /// The name of the type
    pub r#type: String,
}

impl fmt::Display for TypeAndFieldAndType {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(
            f,
            r#"Composite type: "{}", field: "{}", chosen data type: "{}""#,
            self.composite_type, self.field, self.r#type
        )
    }
}

/// An enum value that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct EnumAndValue {
    /// The name of the enum
    pub r#enum: String,
    /// The enum value
    pub value: String,
}

impl fmt::Display for EnumAndValue {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"Enum: "{}", value: "{}""#, self.r#enum, self.value)
    }
}

/// An top level type that triggered a warning.
#[derive(PartialEq, Debug, Clone, Copy)]
pub enum TopLevelType {
    /// A model.
    Model,
    /// An enum.
    Enum,
    /// A view.
    View,
}

impl AsRef<str> for TopLevelType {
    fn as_ref(&self) -> &str {
        match self {
            TopLevelType::Model => "model",
            TopLevelType::Enum => "enum",
            TopLevelType::View => "view",
        }
    }
}

impl fmt::Display for TopLevelType {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.write_str(self.as_ref())
    }
}

/// An top level item that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct TopLevelItem {
    /// The name of the top-level type
    pub r#type: TopLevelType,
    /// The name of the object
    pub name: String,
}

impl fmt::Display for TopLevelItem {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"Type: "{}", name: "{}""#, self.r#type, self.name)
    }
}

/// An object in the PSL.
#[derive(PartialEq, Debug, Clone)]
pub struct Object {
    /// The type of the object.
    pub r#type: &'static str,
    /// The name of the object.
    pub name: String,
}

impl fmt::Display for Object {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"Type: "{}", name: "{}""#, self.r#type, self.name)
    }
}

/// An indexed column that triggered a warning.
#[derive(PartialEq, Debug, Clone)]
pub struct IndexedColumn {
    /// The name of the index
    pub index_name: String,
    /// The name of the column
    pub column_name: String,
}

impl fmt::Display for IndexedColumn {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, r#"Index: "{}", column: "{}""#, self.index_name, self.column_name)
    }
}