23 #include <sys/types.h>
34 #include <google/protobuf/io/zero_copy_stream.h>
35 #include <google/protobuf/io/zero_copy_stream_impl.h>
38 using namespace drizzled;
39 using namespace google;
45 int main(
int argc,
char* argv[])
47 GOOGLE_PROTOBUF_VERIFY_VERSION;
50 cerr <<
"Usage: " << argv[0] <<
" SCHEMA" << endl;
57 int fd= open(argv[1], O_RDONLY);
61 perror(
"Failed to open table definition file");
65 protobuf::io::ZeroCopyInputStream* input=
66 new protobuf::io::FileInputStream(fd);
68 if (!table.ParseFromZeroCopyStream(input))
70 cerr <<
"Failed to parse table." << endl;
79 (void) message::transformTableDefinitionToSql(table, output, message::DRIZZLE,
true);
81 cout << output << endl;