Skip to content

Commit 511b735

Browse files
committed
feat(lib/columns): support retrieving generated columns
1 parent 1197f10 commit 511b735

File tree

4 files changed

+302
-284
lines changed

4 files changed

+302
-284
lines changed

src/lib/sql/columns.sql

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SELECT
3333
WHEN 'd' THEN 'BY DEFAULT'
3434
ELSE NULL
3535
END AS identity_generation,
36+
a.attgenerated IN ('s') AS is_generated,
3637
NOT (
3738
a.attnotnull
3839
OR t.typtype = 'd' AND t.typnotnull

src/lib/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const postgresColumnSchema = Type.Object({
3333
Type.Literal('BY DEFAULT'),
3434
Type.Null(),
3535
]),
36+
is_generated: Type.Boolean(),
3637
is_nullable: Type.Boolean(),
3738
is_updatable: Type.Boolean(),
3839
is_unique: Type.Boolean(),

0 commit comments

Comments
 (0)