Tool to create DocType from DDL SQL files

Many times I have access to tradition DDL SQL files and I want to quickly create the DocType in Frappe. I’m thinking of build a tool to convert DDL to DocType either using the DocType json or API directly.
But before I go down that right, does anyone know if such a tool already exist?

It doesn’t exists, and I think it will be harder to ensure backward compatibility between frappé framework and legacy databases!

Frappé rely a lot on meta-data stored on the database, and this meta-data is crucial to understand the decisions behind the framework.

Like the fact it doesn’t enforce FK’s on SQL level, but use the framework to guarantee the data integrity.
Columns that exists in every record to indicate timestamp, record positioning on the screen, and compound foreign keys.

That’s just some of the biggest cases I think that tool doesn’t exists yet, and why is hard make it to work!

@max_morais_dmm thanks for your response and I agree with all your points.
I’m not looking for a 100% solution but something to can take me to 1st base.
If I can just get all the column names and types from DDL to DocType then that can save me many hours already. I can then address the DocType specifics from that point on.

@mingfang take a look on this

It expose the DDL in the form of object that you will be able to extract almost everything you need!

2 Likes

@max_morais_dmm ddlparse looks great. Thanks!