Closed realtimetodie closed 2 years ago
Example SQL schema
CREATE TABLE "countrylanguage" (
"CountryCode" char(3) NOT NULL DEFAULT '',
"Language" char(30) NOT NULL DEFAULT '',
"IsOfficial" enum('T','F') NOT NULL DEFAULT 'F',
"Percentage" decimal(4,1) NOT NULL DEFAULT '0.0',
PRIMARY KEY ("CountryCode","Language"),
KEY "CountryCode" ("CountryCode"),
CONSTRAINT "countryLanguage_ibfk_1" FOREIGN KEY ("CountryCode") REFERENCES "country" ("Code")
);
Hi thanks a lot for your contribution. I'll take a look this weekend. Sorry for the delay :)
It looks for me @diceride 👍🏽
Resolves #109
Example
This is a first basic implementation. I would like to hear your suggestions how to convert this into a humanly readable table format.
SQL schema statements are very complex. For example, you can define an enum for a field in your SQL schema. At the moment, only the field names are printed out. I think it would be best, to simply print the entire SQL statement for a single row in one line, since there is no interpreter available.
For MongoDB, we can obtain a lot information as JSON. Since MongoDB is schemaless, a schema needs to be inferred probabilistically for a single collection using the crate
mongodb_schema_parser
.The same probabilistic mechanism is used by Compass, the GUI for MongoDB. At the moment, the entire JSON output is printed out.
Data
Output PostgreSQL
Output MySQL
Table users
Output MongoDB