Skip to content

Home > extract-pg-schema > MaterializedViewColumn

MaterializedViewColumn interface

Column in a materialized view.

Signature:

typescript
export interface MaterializedViewColumn

Properties

Property

Modifiers

Type

Description

comment

string | null

Comment on the column.

defaultValue

any

Default value of the column.

expandedType

string

Expanded type name. If the type is an array, brackets will be appended to the type name.

fakeInformationSchemaValue

InformationSchemaColumn

The Postgres information_schema views do not contain info about materialized views. This value is the result of a query that matches the one for regular views. Use with caution, not all fields are guaranteed to be meaningful and/or accurate.

generated

"ALWAYS" | "NEVER" | "BY DEFAULT"

Behavior of the generated column. "ALWAYS" if always generated, "NEVER" if never generated, "BY DEFAULT" if generated when a value is not provided.

indices?

Index[]

(Optional)

isArray

boolean

Whether the column is an array.

isIdentity

boolean

Whether the column is an identity column.

isNullable?

boolean

(Optional) Whether the column is nullable. This is only present if the view is resolved.

isPrimaryKey?

boolean

(Optional) Whether the column is a primary key. This is only present if the view is resolved.

isUpdatable

boolean

Whether the column is updatable.

maxLength

number | null

Maximum length of the column.

name

string

Column name.

ordinalPosition

number

Ordinal position of the column in the view. Starts from 1.

reference?

ColumnReference | null

(Optional)

references?

ColumnReference[]

(Optional) If views are resolved, this will contain the references from the source column in the table that this view references. Note that if the source is another view, that view in turn will be resolved if possible, leading us to a table in the end.

source?

{ schema: string; table: string; column: string; }

(Optional) This will contain a "link" to the source table or view and column, if it can be determined.

type

MaterializedViewColumnType

Type information.