Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions nix/tests/expected/auth.out
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,16 @@ order by
auth | uid | supabase_auth_admin
(3 rows)

-- auth service schema migrations
select * from auth.schema_migrations;
version
----------------
20171026211738
20171026211808
20171026211834
20180103212743
20180108183307
20180119214651
20180125194653
(7 rows)

47 changes: 25 additions & 22 deletions nix/tests/expected/evtrigs.out
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
SELECT
select
e.evtname,
e.evtowner::regrole AS evtowner,
e.evtfoid::regproc AS evtfunction,
p.proowner::regrole AS function_owner
FROM pg_event_trigger e
JOIN pg_proc p
ON e.evtfoid = p.oid
WHERE p.prorettype = 'event_trigger'::regtype;
evtname | evtowner | evtfunction | function_owner
----------------------------------------+----------------+------------------------------------+----------------
issue_pg_net_access | postgres | grant_pg_net_access | postgres
issue_pg_graphql_access | supabase_admin | grant_pg_graphql_access | supabase_admin
issue_graphql_placeholder | supabase_admin | set_graphql_placeholder | supabase_admin
pgrst_ddl_watch | supabase_admin | pgrst_ddl_watch | supabase_admin
pgrst_drop_watch | supabase_admin | pgrst_drop_watch | supabase_admin
graphql_watch_ddl | supabase_admin | graphql.increment_schema_version | supabase_admin
graphql_watch_drop | supabase_admin | graphql.increment_schema_version | supabase_admin
issue_pg_cron_access | supabase_admin | grant_pg_cron_access | postgres
pg_tle_event_trigger_for_drop_function | supabase_admin | pgtle.pg_tle_feature_info_sql_drop | supabase_admin
pgaudit_ddl_command_end | supabase_admin | pgaudit_ddl_command_end | supabase_admin
pgaudit_sql_drop | supabase_admin | pgaudit_sql_drop | supabase_admin
pgsodium_trg_mask_update | supabase_admin | pgsodium.trg_mask_update | supabase_admin
e.evtowner::regrole as evtowner,
n_func.nspname as evtfunction_schema,
e.evtfoid::regproc as evtfunction,
p.proowner::regrole as function_owner
from pg_event_trigger e
join pg_proc p
on e.evtfoid = p.oid
join pg_namespace n_func
on p.pronamespace = n_func.oid
where p.prorettype = 'event_trigger'::regtype;
evtname | evtowner | evtfunction_schema | evtfunction | function_owner
----------------------------------------+----------------+--------------------+------------------------------------+----------------
issue_pg_net_access | postgres | extensions | grant_pg_net_access | postgres
issue_pg_graphql_access | supabase_admin | extensions | grant_pg_graphql_access | supabase_admin
issue_graphql_placeholder | supabase_admin | extensions | set_graphql_placeholder | supabase_admin
pgrst_ddl_watch | supabase_admin | extensions | pgrst_ddl_watch | supabase_admin
pgrst_drop_watch | supabase_admin | extensions | pgrst_drop_watch | supabase_admin
graphql_watch_ddl | supabase_admin | graphql | graphql.increment_schema_version | supabase_admin
graphql_watch_drop | supabase_admin | graphql | graphql.increment_schema_version | supabase_admin
issue_pg_cron_access | supabase_admin | extensions | grant_pg_cron_access | postgres
pg_tle_event_trigger_for_drop_function | supabase_admin | pgtle | pgtle.pg_tle_feature_info_sql_drop | supabase_admin
pgaudit_ddl_command_end | supabase_admin | public | pgaudit_ddl_command_end | supabase_admin
pgaudit_sql_drop | supabase_admin | public | pgaudit_sql_drop | supabase_admin
pgsodium_trg_mask_update | supabase_admin | pgsodium | pgsodium.trg_mask_update | supabase_admin
(12 rows)

22 changes: 22 additions & 0 deletions nix/tests/expected/extensions_schema.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- all default extensions are installed in a schema "extensions"
-- we don't include the version as that will break often, we only care about
-- ensuring these extensions are present
select
e.extname as extension_name,
n.nspname as schema_name,
e.extowner::regrole as extension_owner
from
pg_extension e
join
pg_namespace n on e.extnamespace = n.oid
where
n.nspname = 'extensions' and e.extname != 'pgjwt'
order by
e.extname;
extension_name | schema_name | extension_owner
--------------------+-------------+-----------------
pg_stat_statements | extensions | supabase_admin
pgcrypto | extensions | supabase_admin
uuid-ossp | extensions | supabase_admin
(3 rows)

16 changes: 16 additions & 0 deletions nix/tests/expected/realtime.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- only a publication from supabase realtime is expected
SELECT
pubname AS publication_name,
pubowner::regrole AS owner,
puballtables,
pubinsert,
pubupdate,
pubdelete,
pubtruncate
FROM
pg_publication;
publication_name | owner | puballtables | pubinsert | pubupdate | pubdelete | pubtruncate
-------------------+----------+--------------+-----------+-----------+-----------+-------------
supabase_realtime | postgres | f | t | t | t | t
(1 row)

6 changes: 6 additions & 0 deletions nix/tests/expected/storage.out
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,9 @@ order by
storage | search | supabase_storage_admin
(4 rows)

-- storage service migrations
select * from storage.migrations ;
id | name | hash | executed_at
----+------+------+-------------
(0 rows)

3 changes: 3 additions & 0 deletions nix/tests/sql/auth.sql
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ where
n.nspname = 'auth'
order by
p.proname;

-- auth service schema migrations
select * from auth.schema_migrations;
19 changes: 11 additions & 8 deletions nix/tests/sql/evtrigs.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
SELECT
select
e.evtname,
e.evtowner::regrole AS evtowner,
e.evtfoid::regproc AS evtfunction,
p.proowner::regrole AS function_owner
FROM pg_event_trigger e
JOIN pg_proc p
ON e.evtfoid = p.oid
WHERE p.prorettype = 'event_trigger'::regtype;
e.evtowner::regrole as evtowner,
n_func.nspname as evtfunction_schema,
e.evtfoid::regproc as evtfunction,
p.proowner::regrole as function_owner
from pg_event_trigger e
join pg_proc p
on e.evtfoid = p.oid
join pg_namespace n_func
on p.pronamespace = n_func.oid
where p.prorettype = 'event_trigger'::regtype;
15 changes: 15 additions & 0 deletions nix/tests/sql/extensions_schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- all default extensions are installed in a schema "extensions"
-- we don't include the version as that will break often, we only care about
-- ensuring these extensions are present
select
e.extname as extension_name,
n.nspname as schema_name,
e.extowner::regrole as extension_owner
from
pg_extension e
join
pg_namespace n on e.extnamespace = n.oid
where
n.nspname = 'extensions' and e.extname != 'pgjwt'
order by
e.extname;
11 changes: 11 additions & 0 deletions nix/tests/sql/realtime.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- only a publication from supabase realtime is expected
SELECT
pubname AS publication_name,
pubowner::regrole AS owner,
puballtables,
pubinsert,
pubupdate,
pubdelete,
pubtruncate
FROM
pg_publication;
3 changes: 3 additions & 0 deletions nix/tests/sql/storage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ where
n.nspname = 'storage'
order by
p.proname;

-- storage service migrations
select * from storage.migrations ;