File tree Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,26 @@ export interface Database {
37
37
: schemaTables . map (
38
38
( table ) => `${ JSON . stringify ( table . name ) } : {
39
39
Row: {
40
- ${ table . columns . map (
41
- ( column ) =>
42
- `${ JSON . stringify ( column . name ) } : ${ pgTypeToTsType (
43
- column . format ,
44
- types ,
45
- schemas
46
- ) } ${ column . is_nullable ? '| null' : '' } `
47
- ) }
40
+ ${ [
41
+ ...table . columns . map (
42
+ ( column ) =>
43
+ `${ JSON . stringify ( column . name ) } : ${ pgTypeToTsType (
44
+ column . format ,
45
+ types ,
46
+ schemas
47
+ ) } ${ column . is_nullable ? '| null' : '' } `
48
+ ) ,
49
+ ...schemaFunctions
50
+ . filter ( ( fn ) => fn . argument_types === table . name )
51
+ . map (
52
+ ( fn ) =>
53
+ `${ JSON . stringify ( fn . name ) } : ${ pgTypeToTsType (
54
+ fn . return_type ,
55
+ types ,
56
+ schemas
57
+ ) } `
58
+ ) ,
59
+ ] }
48
60
}
49
61
Insert: {
50
62
${ table . columns . map ( ( column ) => {
Original file line number Diff line number Diff line change 51
51
$$ language plpgsql;
52
52
53
53
CREATE VIEW todos_view AS SELECT * FROM public .todos ;
54
+
55
+ create function public .blurb(public .todos ) returns text as
56
+ $$
57
+ select substring ($1 .details, 1 , 3 );
58
+ $$ language sql stable;
You can’t perform that action at this time.
0 commit comments