ashoknellore / oltpbenchmark

Automatically exported from code.google.com/p/oltpbenchmark
0 stars 0 forks source link

Implement DDL Conversion Utility #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We need a nice and clean way for automatically generating the proper DDL 
commands for each of the different database systems. We do not want to use 
multiple DDL files that are tailored for each of the different systems. One 
idea would be to load a single DDL into a main-memory SQLite database and then 
convert the catalog into the proper format for each system. Worst case scenario 
would be to use hacky regexes.

These are the key things that we need to support:

* DROP TABLE IF EXISTS
* CREATE INDEX
* AUTO_INCREMENT
* BLOB Types

Original issue reported on code.google.com by andy.pa...@gmail.com on 29 Dec 2011 at 4:28

GoogleCodeExporter commented 8 years ago
I forgot that SQLite stores everything as VARCHAR internally:

http://www.sqlite.org/datatype3.html

What I didn't know was that when you get the metadata for a table it will list 
all columns as being a VARCHAR. This means that we can't use SQLite to get the 
internal catalog information for a schema.

I have switched over to HSQLDB and things seem to be working better. Still need 
to pull in FOREIGN KEY information from the catalogs.

Original comment by andy.pa...@gmail.com on 30 Dec 2011 at 3:36