// 1. show databases
        public List <string> show_databases()
        {
            var act = new cpe_wraper.StringReaderAdaptor(0, "", "");
            var cmd = current_db.prepare_read_cmd(@"show databases");

            act.update(cmd);
            current_db.execute_read(cmd, act.load);
            return(act.Values);
        }
Beispiel #2
0
        // 2. show create table
        public string show_createtable()
        {
            var ocs      = new cpe_wraper.StringReaderAdaptor(1, "", "");
            var cmd_text = safeformat.format(@"use {0};show create table {1}", db_name, table_name);
            var cmd      = current_conn.prepare_read_cmd(cmd_text);

            current_conn.execute_read(cmd, ocs.load);
            return(ocs.Values.First());
        }
        // 4. show tables
        public List <string> show_tables()
        {
            var ocs = new cpe_wraper.StringReaderAdaptor(0, "", "");
            var txt = @"use {0};show tables";

            txt = safeformat.format(txt, db_name.database_name);
            var cmd = current_conn.prepare_read_cmd(txt);

            current_conn.execute_read(cmd, ocs.load);
            return(ocs.Values);
        }