. Mostra schema dei database.show databases schema

Restituisce un elenco semplice della struttura dei database selezionati con tutte le tabelle e le colonne in una singola tabella o oggetto JSON.Returns a flat list of the structure of the selected databases with all their tables and columns in a single table or JSON object. Se utilizzata con una versione, il database viene restituito solo se è una versione successiva rispetto alla versione fornita.When used with a version, the database is only returned if it's a later version than the version provided.

Nota

La versione deve essere specificata solo in formato "vMM.mm".The version should only be provided in "vMM.mm" format. MM rappresenta la versione principale e mm rappresentano la versione secondaria.MM represents the major version and mm represent the minor version.

.show``database DatabaseName schema details[if_later_than ] [ "Version"].show database DatabaseName schema [details] [if_later_than "Version"]

.show``database DatabaseName schema [if_later_than "Version"] as``json.show database DatabaseName schema [if_later_than "Version"] as json

.show``databases , DatabaseName1 DatabaseName1 ( ... ) schema [details | as json].show databases ( DatabaseName1, ...) schema [details | as json]

.show``databases "Version" , DatabaseName1 DatabaseName1 if_later_than "Version"... ( ) schema [details | as json].show databases ( DatabaseName1 if_later_than "Version", ...) schema [details | as json]

EsempioExample

Il database ' TestDB ' contiene una tabella denominata ' Events '.The database 'TestDB' has 1 table called 'Events'.

.show database TestDB schema 

Output di esempioExample output

DatabaseNameDatabaseName TableNameTableName ColumnNameColumnName ColumnTypeColumnType IsDefaultTableIsDefaultTable IsDefaultColumnIsDefaultColumn BelnamePrettyName VersioneVersion
TestDBTestDB FalseFalse FalseFalse v. 1.1v.1.1
TestDBTestDB EventsEvents TrueTrue FalseFalse
TestDBTestDB EventsEvents NomeName System.StringSystem.String TrueTrue FalseFalse
TestDBTestDB EventsEvents StartTimeStartTime System.DateTimeSystem.DateTime TrueTrue FalseFalse
TestDBTestDB EventsEvents EndTimeEndTime System.DateTimeSystem.DateTime TrueTrue FalseFalse
TestDBTestDB EventsEvents cityCity System.StringSystem.String TrueTrue FalseFalse
TestDBTestDB EventsEvents SessionIdSessionId System.Int32System.Int32 TrueTrue TrueTrue

EsempioExample

.show database TestDB schema if_later_than "v1.0" 

Output di esempioExample output

DatabaseNameDatabaseName TableNameTableName ColumnNameColumnName ColumnTypeColumnType IsDefaultTableIsDefaultTable IsDefaultColumnIsDefaultColumn BelnamePrettyName VersioneVersion
TestDBTestDB FalseFalse FalseFalse v. 1.1v.1.1
TestDBTestDB EventsEvents TrueTrue FalseFalse
TestDBTestDB EventsEvents NomeName System.StringSystem.String TrueTrue FalseFalse
TestDBTestDB EventsEvents StartTimeStartTime System.DateTimeSystem.DateTime TrueTrue FalseFalse
TestDBTestDB EventsEvents EndTimeEndTime System.DateTimeSystem.DateTime TrueTrue FalseFalse
TestDBTestDB EventsEvents cityCity System.StringSystem.String TrueTrue FalseFalse
TestDBTestDB EventsEvents SessionIdSessionId System.Int32System.Int32 TrueTrue TrueTrue

Poiché è stata specificata una versione precedente alla versione del database corrente, è stato restituito lo schema ' TestDB '.Because a version lower than the current database version was provided, the 'TestDB' schema was returned. La specifica di una versione uguale o superiore avrebbe generato un risultato vuoto.Providing an equal or higher version would have generated an empty result.

EsempioExample

.show database TestDB schema as json

Output di esempioExample output

"{""Databases"":{""TestDB"":{""Name"":""TestDB"",""Tables"":{""Events"":{""Name"":""Events"",""DefaultColumn"":null,""OrderedColumns"":[{""Name"":""Name"",""Type"":""System.String""},{""Name"":""StartTime"",""Type"":""System.DateTime""},{""Name"":""EndTime"",""Type"":""System.DateTime""},{""Name"":""City"",""Type"":""System.String""},{""Name"":""SessionId"",""Type"":""System.Int32""}]}},""PrettyName"":null,""MajorVersion"":1,""MinorVersion"":1,""Functions"":{}}}}"