Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a backup of your Supabase database.
Supabase
const backup = await supabase.rpc('[1]');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a function name that does not exist in Supabase.
Trying to call a method that is not related to backups.
✗ Incorrect
The correct function to create a backup in Supabase is create_backup.
2fill in blank
mediumComplete the code to restore a backup from a file.
Supabase
const result = await supabase.storage.from('backups').[1]('backup-file.sql');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'upload' instead of 'download' to get the backup file.
Trying to use a method that does not exist in Supabase storage.
✗ Incorrect
To restore a backup, you first download the backup file using download.
3fill in blank
hardFix the error in the code to schedule automatic backups.
Supabase
await supabase.functions.[1]('schedule_backup', { cron: '0 0 * * *' });
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'call' or 'run' which are not valid Supabase function methods.
Trying to use 'execute' which is not supported.
✗ Incorrect
The correct method to run a Supabase function is invoke.
4fill in blank
hardFill both blanks to check the status of a backup and log the result.
Supabase
const status = await supabase.backups.[1]('backup-id'); console.[2](status);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fetch' instead of 'getStatus' for backup status.
Using 'print' which is not a console method in JavaScript.
✗ Incorrect
Use getStatus to check backup status and log to print it to the console.
5fill in blank
hardFill all three blanks to create a backup, check its status, and notify the user.
Supabase
const backupId = await supabase.backups.[1](); const status = await supabase.backups.[2](backupId); alert('Backup status: ' + status.[3]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'backupNow' which is not a valid method.
Trying to alert the whole status object instead of its 'state' property.
✗ Incorrect
First, create a backup with createBackup. Then get its status with getStatus. Finally, show the state property in the alert.