Skip to content

Commit 0bf25b9

Browse files
committed
Add NumberOfIdentifierParts.
Signed-off-by: Bradley Grainger <[email protected]>
1 parent d0e58bb commit 0bf25b9

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

src/MySqlConnector/Core/SchemaProvider.g.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ private Task FillMetaDataCollectionsAsync(IOBehavior ioBehavior, DataTable dataT
9393
dataTable.Rows.Add("CharacterSets", 0, 0);
9494
dataTable.Rows.Add("Collations", 0, 0);
9595
dataTable.Rows.Add("CollationCharacterSetApplicability", 0, 0);
96-
dataTable.Rows.Add("Columns", 4, 0);
97-
dataTable.Rows.Add("Databases", 0, 0);
96+
dataTable.Rows.Add("Columns", 4, 4);
97+
dataTable.Rows.Add("Databases", 0, 2);
9898
dataTable.Rows.Add("DataSourceInformation", 0, 0);
9999
dataTable.Rows.Add("DataTypes", 0, 0);
100100
dataTable.Rows.Add("Engines", 0, 0);
@@ -103,21 +103,21 @@ private Task FillMetaDataCollectionsAsync(IOBehavior ioBehavior, DataTable dataT
103103
dataTable.Rows.Add("Parameters", 0, 0);
104104
dataTable.Rows.Add("Partitions", 0, 0);
105105
dataTable.Rows.Add("Plugins", 0, 0);
106-
dataTable.Rows.Add("Procedures", 0, 0);
106+
dataTable.Rows.Add("Procedures", 0, 3);
107107
dataTable.Rows.Add("ProcessList", 0, 0);
108108
dataTable.Rows.Add("Profiling", 0, 0);
109-
dataTable.Rows.Add("ReferentialConstraints", 0, 0);
109+
dataTable.Rows.Add("ReferentialConstraints", 0, 3);
110110
dataTable.Rows.Add("ReservedWords", 0, 0);
111111
dataTable.Rows.Add("ResourceGroups", 0, 0);
112112
dataTable.Rows.Add("Restrictions", 0, 0);
113113
dataTable.Rows.Add("SchemaPrivileges", 0, 0);
114-
dataTable.Rows.Add("Tables", 0, 0);
115-
dataTable.Rows.Add("TableConstraints", 0, 0);
114+
dataTable.Rows.Add("Tables", 0, 3);
115+
dataTable.Rows.Add("TableConstraints", 0, 3);
116116
dataTable.Rows.Add("TablePrivileges", 0, 0);
117117
dataTable.Rows.Add("TableSpaces", 0, 0);
118-
dataTable.Rows.Add("Triggers", 0, 0);
118+
dataTable.Rows.Add("Triggers", 0, 3);
119119
dataTable.Rows.Add("UserPrivileges", 0, 0);
120-
dataTable.Rows.Add("Views", 0, 0);
120+
dataTable.Rows.Add("Views", 0, 3);
121121

122122
return Utility.CompletedTask;
123123
}

tools/SchemaCollectionGenerator/SchemaCollectionGenerator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public async ValueTask<DataTable> GetSchemaAsync(IOBehavior ioBehavior, string c
104104
{
105105
foreach (var schemaCollection in schemaCollections)
106106
{
107-
codeWriter.Write($@" dataTable.Rows.Add(""{schemaCollection.Name}"", {schemaCollection.Restrictions?.Count ?? 0}, 0);
107+
codeWriter.Write($@" dataTable.Rows.Add(""{schemaCollection.Name}"", {schemaCollection.Restrictions?.Count ?? 0}, {schemaCollection.IdentifierPartCount});
108108
");
109109
}
110110
}
@@ -206,6 +206,7 @@ class Schema
206206
public string? Description { get; set; }
207207
public string? Custom { get; set; }
208208
public string? Table { get; set; }
209+
public int IdentifierPartCount { get; set; }
209210
[AllowNull]
210211
public List<Column> Columns { get; set; }
211212
public List<Restriction>? Restrictions { get; set; }

tools/SchemaCollectionGenerator/SchemaCollections.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
- name: Columns
5151
table: COLUMNS
5252
description: information about columns (in all tables)
53+
identifierPartCount: 4
5354
restrictions:
5455
- name: Catalog
5556
default: TABLE_CATALOG
@@ -107,6 +108,7 @@
107108

108109
- name: Databases
109110
table: SCHEMATA
111+
identifierPartCount: 2
110112
columns:
111113
- name: CATALOG_NAME
112114
type: string
@@ -378,6 +380,7 @@
378380

379381
- name: Procedures
380382
description: information about stored procedures
383+
identifierPartCount: 3
381384
table: ROUTINES
382385
columns:
383386
- name: SPECIFIC_NAME
@@ -483,6 +486,7 @@
483486

484487
- name: ReferentialConstraints
485488
table: REFERENTIAL_CONSTRAINTS
489+
identifierPartCount: 3
486490
columns:
487491
- name: CONSTRAINT_CATALOG
488492
type: string
@@ -560,6 +564,7 @@
560564

561565
- name: Tables
562566
table: TABLES
567+
identifierPartCount: 3
563568
columns:
564569
- name: TABLE_CATALOG
565570
type: string
@@ -606,6 +611,7 @@
606611

607612
- name: TableConstraints
608613
table: TABLE_CONSTRAINTS
614+
identifierPartCount: 3
609615
columns:
610616
- name: CONSTRAINT_CATALOG
611617
type: string
@@ -660,6 +666,7 @@
660666

661667
- name: Triggers
662668
table: TRIGGERS
669+
identifierPartCount: 3
663670
columns:
664671
- name: TRIGGER_CATALOG
665672
type: string
@@ -720,6 +727,7 @@
720727

721728
- name: Views
722729
table: VIEWS
730+
identifierPartCount: 3
723731
columns:
724732
- name: TABLE_CATALOG
725733
type: string
@@ -741,5 +749,3 @@
741749
type: string
742750
- name: COLLATION_CONNECTION
743751
type: string
744-
745-

0 commit comments

Comments
 (0)