Not sure if anyone has done this by reverse engineering from total another schema type, But i guess it will not take much time to create 300 doctypes, since this would be a one-time process, even if you write some script like the below attached u would have to define fields mapping so instead you can create itself manually (By dividing among 12 )
There is no option to remove the ‘tab’ prefix. This is hardcoded in 'database.py’ and a few other places in the framework. You’d have to alter that code yourself, and maintain your edits.
As others have said, translating table schemas to frappe doctypes should be doable, with a few caveats. If you’re hoping to automatically convert sql triggers to frappe controller methods, however, that’s probably going to be very challenging.
I am interested in trying to use this feature. Is there any working and well commented sample of Virtual DocType that I can refer to, to learn about this sleek feature?
Thank you for the link. I have already studied this. But I want to understand, what happens if the SQL query returns fields which are not declared in the DocType?
Well, you have to write your own controller (on .py file) that connects to your db, launch the quere, read and transform the data, adapting to the doctype requirements.
Sample:
you have a virtual doctype with First Name, Last Name and Age.
you have a external database with First Name, Last Name, Age and Address
When you receive the data you will consider only the first 3 fields, and must adapt this to the virtual doctype structure (meta fields too: creation date, ownler, assign …). It is not easy, but Virtual Doctypes is a amazing feature.