reformat raw sql for readability
This commit is contained in:
+6
-5
@@ -117,11 +117,13 @@ tables s conn = do
|
|||||||
columns :: String -> String -> Connection -> IO [Column]
|
columns :: String -> String -> Connection -> IO [Column]
|
||||||
columns s t conn = do
|
columns s t conn = do
|
||||||
r <- quickQuery conn
|
r <- quickQuery conn
|
||||||
" select info.table_schema as schema, info.table_name as table_name, \
|
"select info.table_schema as schema, info.table_name as table_name, \
|
||||||
\ info.column_name as name, info.ordinal_position as position, \
|
\ info.column_name as name, info.ordinal_position as position, \
|
||||||
\ info.is_nullable as nullable, info.data_type as col_type, \
|
\ info.is_nullable as nullable, info.data_type as col_type, \
|
||||||
\ info.is_updatable as updatable, info.character_maximum_length as max_len, \
|
\ info.is_updatable as updatable, \
|
||||||
\ info.numeric_precision as precision, info.column_default as default_value,\
|
\ info.character_maximum_length as max_len, \
|
||||||
|
\ info.numeric_precision as precision, \
|
||||||
|
\ info.column_default as default_value, \
|
||||||
\ array_to_string(enum_info.vals, ',') as enum \
|
\ array_to_string(enum_info.vals, ',') as enum \
|
||||||
\ from ( \
|
\ from ( \
|
||||||
\ select table_schema, table_name, column_name, ordinal_position, \
|
\ select table_schema, table_name, column_name, ordinal_position, \
|
||||||
@@ -129,8 +131,7 @@ columns s t conn = do
|
|||||||
\ character_maximum_length, numeric_precision, \
|
\ character_maximum_length, numeric_precision, \
|
||||||
\ column_default, udt_name \
|
\ column_default, udt_name \
|
||||||
\ from information_schema.columns \
|
\ from information_schema.columns \
|
||||||
\ where table_schema = ? \
|
\ where table_schema = ? and table_name = ? \
|
||||||
\ and table_name = ? \
|
|
||||||
\ ) as info \
|
\ ) as info \
|
||||||
\ left outer join ( \
|
\ left outer join ( \
|
||||||
\ select n.nspname as s, \
|
\ select n.nspname as s, \
|
||||||
|
|||||||
Reference in New Issue
Block a user