- Clone this repo.
- Navigate to the root folder and in it, create the
in.txtfile. - Fill in the
in.txtfile while followingn the rules for naming arguments.
Example:TableName1 column_name1 colum_name2 keyTableName3_id
TableName2
TableName3 column_name1 TableName1_id column_name2
TableName4 keykey_name1 - Run
main.py.
The main.py script will create sorted-in.txt, create-db.sql and log.txt file in the root folder.
Navigate to the create-db.sql file to view the newly generated SQL.
Additionally, you can now check the sorted-in.txt file. It contains the sorted contents of the in.txt file.
table namearguments:
Every line must start with one and contain only one. These arguments must be capitalized and can contain small and capital letters, as well as digits.columnarguments:
They can contain small letters, digits and'_'symbols. They represent the column name of the table, and will be assigned an INTEGER data type in the table.foreign keyarguments:
These arguments must end with a"_id"suffix. The part before the"_id"should reference an existing table, and follow the naiming rules fortable namearguments.primary/foreign keyarguments:
Aprimary/foreign keyargument must start with a"key"prefix.
- If
table nameargument isn't capitalized, the script will do it automatically. Also, it will remove any'_'characters from it as well.- If
columnargument contains any capital letters, running the script will replace them with their lower case counterparts.- Part of the
foreign keyargument before the"_id"will be treated as if it was atable nameargument.- If
primary/foreign keyargument represents a column name, the part followinf a"key"prefix will be treated as if it was acolumnargument. And if it represents a foreign key, it's post"key"part would be treated as if it was aforeign keyargument.These changes will be present in both the
create-db.sqlfile and thesorted-in.txtfile.
Check thelog.txtfile for the verbose explanations on these and other user mistakes, and for the script failures.