Skip to content

Commit 15a941e

Browse files
authored
Merge pull request #1190 from mysql-net/schema-collections
Code-generate schema collections.
2 parents cae8714 + d580f39 commit 15a941e

17 files changed

+2114
-620
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ dotnet_diagnostic.SA1503.severity = none # Braces should not be omitted.
105105
dotnet_diagnostic.SA1513.severity = none # Closing brace should be followed by blank line.
106106
dotnet_diagnostic.SA1516.severity = none # Elements should be separated by blank line.
107107
dotnet_diagnostic.SA1600.severity = none # Elements should be documented.
108+
dotnet_diagnostic.SA1601.severity = none # Partial elements should be documented.
108109
dotnet_diagnostic.SA1602.severity = none # Enumeration items should be documented.
109110
dotnet_diagnostic.SA1611.severity = none # Element parameters should be documented.
110111
dotnet_diagnostic.SA1615.severity = none # Element return value should be documented.

MySqlConnector.sln

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27130.2010
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.3.32611.2
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector", "src\MySqlConnector\MySqlConnector.csproj", "{F82378AF-274E-4FBA-8E45-27126D607B85}"
66
EndProject
@@ -20,6 +20,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector.Logging.NLog
2020
EndProject
2121
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector.Authentication.Ed25519", "src\MySqlConnector.Authentication.Ed25519\MySqlConnector.Authentication.Ed25519.csproj", "{5DB4FA2E-910B-47CE-B467-F6852104D567}"
2222
EndProject
23+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{D0EDA522-FB29-4C44-B4EC-0D3AF72C016D}"
24+
EndProject
25+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchemaCollectionGenerator", "tools\SchemaCollectionGenerator\SchemaCollectionGenerator.csproj", "{2C8FA08E-755D-454D-B98E-10A122673ABE}"
26+
EndProject
2327
Global
2428
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2529
Debug|Any CPU = Debug|Any CPU
@@ -62,10 +66,17 @@ Global
6266
{5DB4FA2E-910B-47CE-B467-F6852104D567}.Debug|Any CPU.Build.0 = Debug|Any CPU
6367
{5DB4FA2E-910B-47CE-B467-F6852104D567}.Release|Any CPU.ActiveCfg = Release|Any CPU
6468
{5DB4FA2E-910B-47CE-B467-F6852104D567}.Release|Any CPU.Build.0 = Release|Any CPU
69+
{2C8FA08E-755D-454D-B98E-10A122673ABE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
70+
{2C8FA08E-755D-454D-B98E-10A122673ABE}.Debug|Any CPU.Build.0 = Debug|Any CPU
71+
{2C8FA08E-755D-454D-B98E-10A122673ABE}.Release|Any CPU.ActiveCfg = Release|Any CPU
72+
{2C8FA08E-755D-454D-B98E-10A122673ABE}.Release|Any CPU.Build.0 = Release|Any CPU
6573
EndGlobalSection
6674
GlobalSection(SolutionProperties) = preSolution
6775
HideSolutionNode = FALSE
6876
EndGlobalSection
77+
GlobalSection(NestedProjects) = preSolution
78+
{2C8FA08E-755D-454D-B98E-10A122673ABE} = {D0EDA522-FB29-4C44-B4EC-0D3AF72C016D}
79+
EndGlobalSection
6980
GlobalSection(ExtensibilityGlobals) = postSolution
7081
SolutionGuid = {4784EA55-5DE0-404F-8BEC-E14C202F01FA}
7182
EndGlobalSection

docs/content/overview/schema-collections.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
date: 2021-04-24
3+
lastmod: 2022-08-12
34
menu:
45
main:
56
parent: getting started
@@ -14,32 +15,32 @@ weight: 80
1415

1516
`MySqlConnection.GetSchema` supports the following schemas:
1617

17-
* `MetaDataCollections`—information about available schemas
18+
* `MetaDataCollections`[information about available schemas](../schema/metadatacollections/)
1819
* `CharacterSets`
1920
* `Collations`
2021
* `CollationCharacterSetApplicability`
21-
* `Columns`
22+
* `Columns`[information about columns (in all tables)](../schema/columns/)
2223
* `Databases`
23-
* `DataTypes`—information about available data types
24+
* `DataSourceInformation`
25+
* `DataTypes`[information about available data types](../schema/datatypes/)
2426
* `Engines`
2527
* `KeyColumnUsage`
2628
* `KeyWords`
2729
* `Parameters`
2830
* `Partitions`
2931
* `Plugins`
30-
* `Procedures`—information about stored procedures
32+
* `Procedures`[information about stored procedures](../schema/procedures/)
3133
* `ProcessList`
3234
* `Profiling`
3335
* `ReferentialConstraints`
34-
* `ReservedWords`—information about reserved words in the server's SQL syntax
36+
* `ReservedWords`[information about reserved words in the server's SQL syntax](../schema/reservedwords/)
3537
* `ResourceGroups`
38+
* `Restrictions`[information about the restrictions supported when retrieving schemas](../schema/restrictions/)
3639
* `SchemaPrivileges`
37-
* `Tables`
40+
* `Tables`[information about tables](../schema/tables/)
3841
* `TableConstraints`
3942
* `TablePrivileges`
4043
* `TableSpaces`
4144
* `Triggers`
4245
* `UserPrivileges`
4346
* `Views`
44-
45-
The `GetSchema(string, string[])` overload that specifies restrictions is not supported.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
date: 2022-07-10
3+
lastmod: 2022-07-11
4+
title: Columns Schema
5+
---
6+
7+
# Columns Schema
8+
9+
The `Columns` schema provides information about columns (in all tables).
10+
11+
Column Name | Data Type | Description
12+
--- | --- | ---
13+
TABLE_CATALOG | string |
14+
TABLE_SCHEMA | string |
15+
TABLE_NAME | string |
16+
COLUMN_NAME | string |
17+
ORDINAL_POSITION | uint |
18+
COLUMN_DEFAULT | string |
19+
IS_NULLABLE | string |
20+
DATA_TYPE | string |
21+
CHARACTER_MAXIMUM_LENGTH | long |
22+
NUMERIC_PRECISION | ulong |
23+
NUMERIC_SCALE | ulong |
24+
DATETIME_PRECISION | uint |
25+
CHARACTER_SET_NAME | string |
26+
COLLATION_NAME | string |
27+
COLUMN_TYPE | string |
28+
COLUMN_KEY | string |
29+
EXTRA | string |
30+
PRIVILEGES | string |
31+
COLUMN_COMMENT | string |
32+
GENERATION_EXPRESSION | string |
33+
SRS_ID | string |
34+
35+
The following restrictions are supported:
36+
37+
Restriction Name | Restriction Default | Restriction Number
38+
--- | --- | --:
39+
Catalog | TABLE_CATALOG | 1
40+
Schema | TABLE_SCHEMA | 2
41+
Table | TABLE_NAME | 3
42+
Column | COLUMN_NAME | 4
43+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
date: 2022-07-10
3+
lastmod: 2022-07-11
4+
title: DataTypes Schema
5+
---
6+
7+
# DataTypes Schema
8+
9+
The `DataTypes` schema provides information about available data types.
10+
11+
Column Name | Data Type | Description
12+
--- | --- | ---
13+
TypeName | string |
14+
ProviderDbType | int |
15+
ColumnSize | long |
16+
CreateFormat | string |
17+
CreateParameters | string |
18+
DataType | string |
19+
IsAutoIncrementable | bool |
20+
IsBestMatch | bool |
21+
IsCaseSensitive | bool |
22+
IsFixedLength | bool |
23+
IsFixedPrecisionScale | bool |
24+
IsLong | bool |
25+
IsNullable | bool |
26+
IsSearchable | bool |
27+
IsSearchableWithLike | bool |
28+
IsUnsigned | bool |
29+
MaximumScale | short |
30+
MinimumScale | short |
31+
IsConcurrencyType | bool |
32+
IsLiteralSupported | bool |
33+
LiteralPrefix | string |
34+
LiteralSuffix | string |
35+
NativeDataType | string |
36+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
date: 2022-07-10
3+
lastmod: 2022-07-11
4+
title: MetaDataCollections Schema
5+
---
6+
7+
# MetaDataCollections Schema
8+
9+
The `MetaDataCollections` schema provides information about available schemas.
10+
11+
Column Name | Data Type | Description
12+
--- | --- | ---
13+
CollectionName | string | The name of the collection to pass to the GetSchema method to return the collection.
14+
NumberOfRestrictions | int | The number of restrictions that may be specified for the collection.
15+
NumberOfIdentifierParts | int | The number of parts in the composite identifier/database object name.
16+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
date: 2022-07-10
3+
lastmod: 2022-07-11
4+
title: Procedures Schema
5+
---
6+
7+
# Procedures Schema
8+
9+
The `Procedures` schema provides information about stored procedures.
10+
11+
Column Name | Data Type | Description
12+
--- | --- | ---
13+
SPECIFIC_NAME | string |
14+
ROUTINE_CATALOG | string |
15+
ROUTINE_SCHEMA | string |
16+
ROUTINE_NAME | string |
17+
ROUTINE_TYPE | string |
18+
DTD_IDENTIFIER | string |
19+
ROUTINE_BODY | string |
20+
ROUTINE_DEFINITION | string |
21+
EXTERNAL_NAME | string |
22+
EXTERNAL_LANGUAGE | string |
23+
PARAMETER_STYLE | string |
24+
IS_DETERMINISTIC | string |
25+
SQL_DATA_ACCESS | string |
26+
SQL_PATH | string |
27+
SECURITY_TYPE | string |
28+
CREATED | DateTime |
29+
LAST_ALTERED | DateTime |
30+
SQL_MODE | string |
31+
ROUTINE_COMMENT | string |
32+
DEFINER | string |
33+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
date: 2022-07-10
3+
lastmod: 2022-07-11
4+
title: ReservedWords Schema
5+
---
6+
7+
# ReservedWords Schema
8+
9+
The `ReservedWords` schema provides information about reserved words in the server's SQL syntax.
10+
11+
Column Name | Data Type | Description
12+
--- | --- | ---
13+
ReservedWord | string |
14+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
date: 2022-07-10
3+
lastmod: 2022-07-11
4+
title: Restrictions Schema
5+
---
6+
7+
# Restrictions Schema
8+
9+
The `Restrictions` schema provides information about the restrictions supported when retrieving schemas.
10+
11+
Column Name | Data Type | Description
12+
--- | --- | ---
13+
CollectionName | string | The name of the collection that these restrictions apply to.
14+
RestrictionName | string | The name of the restriction in the collection.
15+
RestrictionDefault | string | Ignored.
16+
RestrictionNumber | int | The actual location in the collections restrictions that this particular restriction falls in.
17+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
date: 2022-07-10
3+
lastmod: 2022-08-12
4+
title: Tables Schema
5+
---
6+
7+
# Tables Schema
8+
9+
The `Tables` schema provides information about tables.
10+
11+
Column Name | Data Type | Description
12+
--- | --- | ---
13+
TABLE_CATALOG | string |
14+
TABLE_SCHEMA | string |
15+
TABLE_NAME | string |
16+
TABLE_TYPE | string |
17+
ENGINE | string |
18+
VERSION | string |
19+
ROW_FORMAT | string |
20+
TABLE_ROWS | long |
21+
AVG_ROW_LENGTH | long |
22+
DATA_LENGTH | long |
23+
MAX_DATA_LENGTH | long |
24+
INDEX_LENGTH | long |
25+
DATA_FREE | long |
26+
AUTO_INCREMENT | long |
27+
CREATE_TIME | DateTime |
28+
UPDATE_TIME | DateTime |
29+
CHECK_TIME | DateTime |
30+
TABLE_COLLATION | string |
31+
CHECKSUM | string |
32+
CREATE_OPTIONS | string |
33+
TABLE_COMMENT | string |
34+
35+
The following restrictions are supported:
36+
37+
Restriction Name | Restriction Default | Restriction Number
38+
--- | --- | --:
39+
Catalog | TABLE_CATALOG | 1
40+
Schema | TABLE_SCHEMA | 2
41+
Table | TABLE_NAME | 3
42+
TableType | TABLE_TYPE | 4
43+

0 commit comments

Comments
 (0)