r-dbi/DBI

Can the SQL statement of the table be returned

zoushucai opened this issue · 2 comments

eg:

dbExecute(con, "show create table table_names;")

where table_names is the name of a table in the database. I expect to return an SQL statement similar to the following

CREATE TABLE `stu5` (
  `id` varchar(2) DEFAULT NULL,
  `name` varchar(2) DEFAULT NULL,
....
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

Thanks. Reverse-engineering an existing database is out of scope for DBI, perhaps Liquibase can help: https://www.liquibase.org/.

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.