Fixed postgresql config queries

This commit is contained in:
simov
2013-11-24 15:46:25 +02:00
parent 50272016bd
commit 2049ac2aae
+4 -3
View File
@@ -45,12 +45,13 @@ exports.sql = function (name) {
// config queries
case 'show-tables': s = this.client.mysql
? "SHOW TABLES IN `{0}` ;"
: "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ;";
: "SELECT table_name FROM information_schema.tables WHERE table_schema = '{0}' ;";
break;
case 'show-columns': s = this.client.mysql
? "SHOW COLUMNS IN `{0}` IN `{1}` ;"
: 'SELECT column_name AS "Field", data_type AS "Type", is_nullable AS "Null", \'?\' AS "Key", column_default AS "Default", \'?\' AS "Extra" FROM information_schema.columns WHERE table_name =\'{0}\';';
// describe table_name ; - same
: 'SELECT column_name AS "Field", data_type AS "Type", is_nullable AS "Null", column_default AS "Default", '+
'numeric_precision, numeric_precision_radix, numeric_scale, character_maximum_length '+
'FROM information_schema.columns WHERE table_schema = \'{0}\' AND table_name = \'{1}\' ;';
break;
default: s = 'Query name doesn\'t exist'; break;