MySqlBackupNET/MySqlBackup.Net

List of Tables and extracting data from each Table

sharathsridhar opened this issue · 2 comments

Hello,

(This is not an issue :) )

Is there a method/property that will list out all tables in the database I just restored? I am unable to find it. Currently I am getting a list of tables by running a sql query and running it (using cmd.executereader).

Additionally, I see that you said we can export rows to Memory Stream, could you please tell me how? Again, I am running "Select * from tablename" and executing that query and storing the result in a datatable.

Thank You.

Hi, currently, it's unable to identify which tables that has just restored.
It is however possible, by modifying the source code.
During the import, you may try to search the keywords like "CREATE TABLE", then you may manually identify the table name from the line before it is sent into MySQL server.
I have tried similar attempt in the previous version looking for multiple keywords in the line, but however, this action will slow down the whole process a lot and consume lots of memory.
It also creates lots of potential bugs too.
It is strongly not recommended to perform such actions.

For exporting the dump file into memory, you may refer to this wiki page:
https://github.com/MySqlBackupNET/MySqlBackup.Net/wiki/Example-of-Using-in-MemoryStream,-Zip-and-ASP.NET

@adriancs2 Thank You. I think I should go with Sql statements and executing them. Thank You.