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 {
3737 : schemaTables . map (
3838 ( table ) => `${ JSON . stringify ( table . name ) } : {
3939 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+ ] }
4860 }
4961 Insert: {
5062 ${ table . columns . map ( ( column ) => {
Original file line number Diff line number Diff line change 5151$$ language plpgsql;
5252
5353CREATE 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