I'm trying to retrieve a type of key value pair from the following string:
CREATE TABLE "BoilerModels" ("ID" INTEGER PRIMARY KEY NOT NULL UNIQUE, "BoilerModelID" INTEGER NOT NULL DEFAULT 0, "BoilerManufacturerID" INTEGER NOT NULL DEFAULT 0, "Model" VARCHAR NOT NULL, "IsDeleted" VARCHAR NOT NULL DEFAULT "N", "LastUpdated" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, "DateCreated" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, "Version" INTEGER NOT NULL DEFAULT 0)
What I want to retrieve is the field name, the type and the default value (if there is one).
So the output would be something like:
BoilerModelID INTEGER 0
BoilerManufacturerID INTEGER 0
IsDeleted VARCHAR N
LastUpdated DATETIME CURRENT_TIMESTAMP
DateCreated DATETIME CURRENT_TIMESTAMP
Version INTEGER 0
I've got this far...
(?:, "(.*?)").*(?:DEFAULT "?(\w*)?"?)
But am now royally stuck! Can anyone please help?