File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ test('basic select table', async () => {
9
9
expect ( res ) . toMatchSnapshot ( )
10
10
} )
11
11
12
+ test ( 'basic select view' , async ( ) => {
13
+ const res = await postgrest . from ( 'updatable_view' ) . select ( )
14
+ expect ( res ) . toMatchSnapshot ( )
15
+ } )
16
+
12
17
test ( 'rpc' , async ( ) => {
13
18
const res = await postgrest . rpc ( 'get_status' , { name_param : 'supabot' } )
14
19
expect ( res ) . toMatchSnapshot ( )
@@ -410,3 +415,13 @@ test('select with no match', async () => {
410
415
}
411
416
` )
412
417
} )
418
+
419
+ test ( 'cannot update non-updatable views' , ( ) => {
420
+ // @ts -expect-error TS2345
421
+ postgrest . from ( 'non_updatable_view' ) . update ( { } )
422
+ } )
423
+
424
+ test ( 'cannot update non-updatable columns' , ( ) => {
425
+ // @ts -expect-error TS2322
426
+ postgrest . from ( 'updatable_view' ) . update ( { non_updatable_column : 0 as any } )
427
+ } )
You can’t perform that action at this time.
0 commit comments