The plain text can be formatted in any number of different ways. The only assumptions are that the first row contains the header names, and that there is a consistent delimiter between each "cell". See ddl_builder/qunit/fixture.html for examples of the variety of formats supported.
The code will determine the proper column type based on the data provided, including field length (based on the longest value).
Right now, the database products supported are MySQL, Oracle, PostgreSQL, SQLite, and MS SQL Server (2008+).
##Running the example
I've provided an extremely simple plain HTML UI that makes uses of this library. If you download this project into any web-accessible folder and browse to /index.html, you will have the option to add input text and transform it into the expected DDL/DML.
This should provide sufficient clarity as to how the whole thing works. If you are a bit lost, I suggest looking at /main.js; this contains the dependency loading, instantiation, UI bindings and execution calls that are used to make the library do useful things. You'll need to do something quite similar to make it work in your project.
You can move around some of the paths of things fairly easily; you'll just need to make sure that wherever you move them, you update the paths in your main call to requirejs.config().
You can also run the QUnit tests by browsing to /qunit.html
- RequireJS for dependency management and module loading
- jQuery core, miscellaneous JS library
- Steven Levithan's Date Format for formatting dates (naturally) in the output
- QUnit for Unit testing
Copyright Jake Feasel, 2012
Released under the terms of the MIT License.