From 359555f4680377f0f12b4ed58860620ef3cd08f4 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Mon, 30 Oct 2023 11:05:06 -0400 Subject: [PATCH] Infer INSERT INTO AS --- src/infer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/infer.rs b/src/infer.rs index f6bc8eb..d208c9d 100644 --- a/src/infer.rs +++ b/src/infer.rs @@ -181,7 +181,11 @@ impl InferTypes for ast::InsertIntoStatement { } Ok(((), scope.clone())) } - ast::InsertedData::Select { query, .. } => Err(nyi(query, "INSERT INTO .. AS")), + ast::InsertedData::Select { query, .. } => { + let (ty, _scope) = query.infer_types(scope)?; + ty.expect_subtype_ignoring_nullability_of(table_type, query)?; + Ok(((), scope.clone())) + } } } }