table:conf['type']==='oracle'?`SELECT * FROM (SELECT A.*,ROWNUM N FROM ${table} A) WHERE N=1`:`USE [${this.dbconf['database']}];SELECT TOP 0 * FROM ${table}`
table:sql
})
})
).then((res)=>{
).then((res)=>{
letret=res['text'];
letret=res['text'];
if(ret.indexOf("ERROR://")>-1){
throwret;
}
constarr=ret.split('\t');
constarr=ret.split('\t');
const_db=newBuffer(db).toString('base64');
const_db=newBuffer(db).toString('base64');
const_table=newBuffer(table).toString('base64');
const_table=newBuffer(table).toString('base64');
...
@@ -526,11 +555,20 @@ class ASP {
...
@@ -526,11 +555,20 @@ class ASP {
this.manager.list.imgs[3]
this.manager.list.imgs[3]
);
);
});
});
letpresql="";
switch(this.dbconf['type']){
case'mysql':
presql=`SELECT * FROM \`${table}\` ORDER BY 1 DESC LIMIT 0,20;`;
break;
case'oracle':
presql=`SELECT * FROM ${db}.${table} WHERE ROWNUM < 20 ORDER BY 1`;
break;
default:
presql=`SELECT TOP 20 * from [${table}] ORDER BY 1 DESC;`;