From 24922bc98b605ac5a538619831a56c620a44ea9e Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Thu, 25 Jul 2013 15:03:03 -0700 Subject: [PATCH] Add precision/scale --- lib/discovery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/discovery.js b/lib/discovery.js index f45e901..a42542a 100644 --- a/lib/discovery.js +++ b/lib/discovery.js @@ -154,14 +154,14 @@ function mixinDiscovery(MySQL) { var sql = null; if (owner) { sql = paginateSQL('SELECT table_schema AS "owner", table_name AS "tableName", column_name AS "columnName", data_type AS "dataType",' - + ' character_octet_length AS "dataLength", is_nullable AS "nullable"' + + ' character_octet_length AS "dataLength", numeric_precision AS "dataPrecision", numeric_scale AS "dataScale", is_nullable AS "nullable"' + ' FROM information_schema.columns' + ' WHERE table_schema=\'' + owner + '\'' + (table ? ' AND table_name=\'' + table + '\'' : ''), 'table_name, ordinal_position', {}); } else { sql = paginateSQL('SELECT SUBSTRING_INDEX(USER(), \'@\', 1) AS "owner", table_name AS "tableName", column_name AS "columnName", data_type AS "dataType",' - + ' character_octet_length AS "dataLength", is_nullable AS "nullable"' + + ' character_octet_length AS "dataLength", numeric_precision AS "dataPrecision", numeric_scale AS "dataScale", is_nullable AS "nullable"' + ' FROM information_schema.columns' + (table ? ' WHERE table_name=\'' + table + '\'' : ''), 'table_name, ordinal_position', {});