@@ -135,6 +135,13 @@ function mixinDiscovery(PostgreSQL) {
135
135
cb ( err , results ) ;
136
136
} else {
137
137
results . map ( function ( r ) {
138
+ // PostgreSQL returns ALWAYS in case the property is generated,
139
+ // otherwise it returns NEVER
140
+ if ( r . generated === 'ALWAYS' ) {
141
+ r . generated = true ;
142
+ } else {
143
+ r . generated = false ;
144
+ }
138
145
// PostgreSQL accepts float(1) to float(24) as selecting the `real` type,
139
146
// while float(25) to float(53) select `double precision`
140
147
// https://www.postgresql.org/docs/9.4/static/datatype-numeric.html
@@ -166,6 +173,7 @@ function mixinDiscovery(PostgreSQL) {
166
173
if ( owner ) {
167
174
sql = this . paginateSQL ( 'SELECT table_schema AS "owner", table_name AS "tableName", column_name AS "columnName",'
168
175
+ 'data_type AS "dataType", character_maximum_length AS "dataLength", numeric_precision AS "dataPrecision",'
176
+ + ' is_generated AS "generated",'
169
177
+ ' numeric_scale AS "dataScale", is_nullable AS "nullable"'
170
178
+ ' FROM information_schema.columns'
171
179
+ ' WHERE table_schema=\'' + owner + '\''
@@ -175,6 +183,7 @@ function mixinDiscovery(PostgreSQL) {
175
183
sql = this . paginateSQL ( 'SELECT current_schema() AS "owner", table_name AS "tableName",'
176
184
+ ' column_name AS "columnName",'
177
185
+ ' data_type AS "dataType", character_maximum_length AS "dataLength", numeric_precision AS "dataPrecision",'
186
+ + ' is_generated AS "generated",'
178
187
+ ' numeric_scale AS "dataScale", is_nullable AS "nullable"'
179
188
+ ' FROM information_schema.columns'
180
189
+ ( table ? ' WHERE table_name=\'' + table + '\'' : '' ) ,
0 commit comments