Changes the insertable to true in views that are insertable through triggers [fixes #206]

This commit is contained in:
Diogo Biazus
2015-06-22 00:16:23 -04:00
parent e93c96a6f8
commit f4011e5d8c
4 changed files with 38 additions and 5 deletions
+5 -4
View File
@@ -44,8 +44,9 @@ tables schema = do
rows <- H.listEx $
[H.stmt|
select table_schema, table_name,
is_insertable_into
from information_schema.tables
t.is_insertable_into::boolean OR coalesce(is_trigger_insertable_into::boolean, false)
from information_schema.tables t
left join information_schema.views using(table_catalog, table_schema, table_name)
where table_schema = ?
order by table_name
|] schema
@@ -135,8 +136,8 @@ data Column = Column {
, colFK :: Maybe ForeignKey
} deriving (Show)
tableFromRow :: (Text, Text, Text) -> Table
tableFromRow (s, n, i) = Table s n (toBool i)
tableFromRow :: (Text, Text, Bool) -> Table
tableFromRow (s, n, i) = Table s n i
columnFromRow :: (Text, Text, Text,
Int, Text, Text,