Skip to content

Commit

Permalink
use stored instead of isgenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
Gil Mizrahi committed Jan 18, 2024
1 parent cc8b272 commit 8c4f3ae
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ WITH
END
AS is_identity,
CASE WHEN attgenerated_exists
THEN CASE WHEN attgenerated::text = 's' THEN 'isGenerated' ELSE 'notGenerated' END
THEN CASE WHEN attgenerated::text = 's' THEN 'stored' ELSE 'notGenerated' END
ELSE 'notGenerated'
END as is_generated
FROM
Expand Down
2 changes: 1 addition & 1 deletion crates/connectors/ndc-postgres/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ fn make_object_type(
match column {
// columns that are generated or are always identity should not be insertable.
metadata::database::ColumnInfo {
is_generated: metadata::database::IsGenerated::IsGenerated,
is_generated: metadata::database::IsGenerated::Stored,
..
}
| metadata::database::ColumnInfo {
Expand Down
2 changes: 1 addition & 1 deletion crates/query-engine/metadata/src/metadata/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub enum IsIdentity {
pub enum IsGenerated {
#[default]
NotGenerated,
IsGenerated,
Stored,
}

/// Information about a database column.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn check_columns(
} => Ok(()),
// generated columns must not be inserted into.
database::ColumnInfo {
is_generated: database::IsGenerated::IsGenerated,
is_generated: database::IsGenerated::Stored,
..
} => {
if inserted_columns.contains(&ast::ColumnName(column.name.clone())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ expression: schema
"type": "string",
"enum": [
"notGenerated",
"isGenerated"
"stored"
]
},
"CompositeTypes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ expression: schema
"type": "string",
"enum": [
"notGenerated",
"isGenerated"
"stored"
]
},
"UniquenessConstraints": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ expression: default_configuration
},
"nullable": "nullable",
"hasDefault": "hasDefault",
"isGenerated": "isGenerated",
"isGenerated": "stored",
"description": null
},
"id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ expression: generated_schema_json
"type": "string",
"enum": [
"notGenerated",
"isGenerated"
"stored"
]
},
"CompositeTypes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@
},
"nullable": "nullable",
"hasDefault": "hasDefault",
"isGenerated": "isGenerated",
"isGenerated": "stored",
"description": null
},
"id": {
Expand Down Expand Up @@ -1046,6 +1046,30 @@
}
},
"nativeQueries": {
"address_identity_function": {
"sql": "SELECT {{address}} as result",
"columns": {
"result": {
"name": "result",
"type": {
"compositeType": "person_address"
},
"nullable": "nullable",
"description": null
}
},
"arguments": {
"address": {
"name": "address",
"type": {
"compositeType": "person_address"
},
"nullable": "nullable",
"description": null
}
},
"description": "A native query used to test support for composite types"
},
"album_by_title": {
"sql": "SELECT * FROM public.\"Album\" WHERE \"Title\" LIKE {{title}} AND \"AlbumId\" < {{id}}",
"columns": {
Expand Down
2 changes: 1 addition & 1 deletion static/postgres/v2-chinook-deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@
},
"nullable": "nullable",
"hasDefault": "hasDefault",
"isGenerated": "isGenerated",
"isGenerated": "stored",
"description": null
},
"id": {
Expand Down

0 comments on commit 8c4f3ae

Please sign in to comment.