Commit 95b449a
authored
fix: make virtual columns nullable (#480)
psteinroe contributed a change which adds schema functions which take only the table name as columns on the tables when generating TypeScript types.
This commit extends that to treat function return types as nullable.
The function used in `oo-init.sql` could be changed like so:
```sql
create function public.blurb(public.todos) returns text as
$$
select null;
$$ language sql stable;
```
It would still compile and be a valid function despite the unchanged return type, which means any function must be treated as potentially returning `null` in the types.
I have also updated instructions for building and testing the TypeScript type generation.1 parent d3b6316 commit 95b449a
2 files changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
0 commit comments