Repository: AlecStrong/sql-psi (kotlin)

Issue:
Insert statements for nonnull generated columns fail to compile
### SQLDelight Version

2.0.0-alpha02

### Operating System

macOS 12.3.1 (21E258)

### Gradle Version

7.4.2

### Kotlin Version

1.6.21

### AGP Version

7.1.3

### Describe the Bug

I get an error when trying to compile the following valid SQLDelight file:
```
CREATE TABLE objects (
    id TEXT GENERATED ALWAYS AS (json_extract(object, "$.id")) UNIQUE NOT NULL,
    object TEXT NOT NULL
);

insert:
INSERT INTO objects(object) VALUES (?);
```

I get this error:
```
Test.sq: (7, 0): Cannot populate default value for column id, it must be specified in insert statement.
7    INSERT INTO objects(object) VALUES (?)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

This is an edge case with the new generated columns support. Because `id` is generated, it should not be required to be a part of the `INSERT` statement

### Stacktrace

_No response_

### Gradle Build Script

_No response_

Pull request:
Closes https://github.com/cashapp/sqldelight/issues/3167

Patch:
diff --git a/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/ColumnDefMixin.kt b/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/ColumnDefMixin.kt
index a966aaaa..2891e05c 100644
--- a/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/ColumnDefMixin.kt
+++ b/core/src/main/kotlin/com/alecstrong/sql/psi/core/psi/mixins/ColumnDefMixin.kt
@@ -9,6 +9,7 @@ abstract class ColumnDefMixin(node: ASTNode) : SqlCompositeElementImpl(node), Sq
 
   open fun hasDefaultValue(): Boolean {
     return columnConstraintList.any { it.defaultConstraint != null } ||
-      columnConstraintList.none { it.node.findChildByType(SqlTypes.NOT) != null }
+      columnConstraintList.none { it.node.findChildByType(SqlTypes.NOT) != null } ||
+      columnConstraintList.any { it.generatedClause != null }
   }
 }


Test patch:
diff --git a/test-fixtures/src/main/resources/fixtures/generated-default/Test.s b/test-fixtures/src/main/resources/fixtures/generated-default/Test.s
new file mode 100644
index 00000000..e5e568dd
--- /dev/null
+++ b/test-fixtures/src/main/resources/fixtures/generated-default/Test.s
@@ -0,0 +1,6 @@
+CREATE TABLE objects (
+    id TEXT GENERATED ALWAYS AS (2) UNIQUE NOT NULL,
+    object TEXT NOT NULL
+);
+
+INSERT INTO objects(object) VALUES (?);
\ No newline at end of file