Get startedGet started for free

Permissions and plan mode

1. Permissions and plan mode

CoCo can query your data, change it, and run commands on your machine.

2. You decide

In this video, you'll decide how much of that it can do on its own.

3. The plan

We'll start with the requests CoCo runs right away, and the ones it checks with you first.

4. The plan

Next, you'll see the two permission modes and how to switch between them.

5. The plan

Then you'll ask CoCo to plan a change, so you can review it before anything runs.

6. The plan

Finally, you'll open a read-only session, where nothing in your data can change.

7. Runs without asking

Some requests never need your approval, because they only read. CoCo runs a select query, lists the tables in a schema, or describes a table's columns straight away, and it can read the files in your folder too. That's why you haven't approved anything in this course yet.

8. Asks for approval

Anything that makes a change waits for you. That includes SQL that creates, inserts, updates, or deletes, edits to your files, and shell commands that delete files or download from the internet.

9. Approving a change

For example, when you ask CoCo for a table of monthly revenue without cancelled orders, it stops before running anything, shows you the exact statement, and asks how to proceed.

10. The three options

Yes runs the statement once.

11. The three options

Allow CREATE in any schema runs it and approves every later create in this session.

12. The three options

No cancels it, and you can then tell CoCo what you'd like instead.

13. Permission modes

Whether you see that box depends on the permission mode. In confirm actions, the default, CoCo asks before every change.

14. Permission modes

In bypass safeguards, it makes changes without asking, which only makes sense in a test environment you can throw away.

15. Switching with Shift+Tab

You can always see your current mode in the status bar, highlighted here in the bottom left.

16. Switching with Shift+Tab

Press Shift Tab to switch modes, and bypass safeguards appears in red so it's hard to miss.

17. Plan mode with Ctrl+P

Approving one statement at a time works well for small changes.

18. Plan mode with Ctrl+P

But when a change touches several tables, or the data is new to you, it's better to see the whole approach first.

19. Plan mode with Ctrl+P

Press Control P, or type slash plan, and the status bar shows that plan mode is on.

20. Reading the plan

Ask for the same table again. This time, CoCo looks into the data without changing it and comes back with a plan: the steps it'll take, the exact SQL it intends to run, and how it'll check the result.

21. Approving the plan

Nothing runs until you answer. Yes carries out the plan, and pressing Tab first lets you add an instruction, such as rounding revenue to two decimals. You can also accept future plans automatically, or say no and ask for a different approach.

22. The new table

Once you approve, plan mode switches off and CoCo creates the table, with one row for each month and revenue rounded as you asked.

23. Read-only sessions

Sometimes you only want to explore, with no risk of changing anything. Start CoCo with the sql read-only flag, and the status bar shows that SQL is read-only.

24. Writes are refused

In this mode, you can still ask CoCo to create a table, and it will still ask for your approval. But even after you approve, Snowflake rejects the statement and CoCo shows the error in red. Snowflake enforces the rule itself, so no approval can get around it.

25. Turning it off with /guardrails

When you're ready to make changes again, type slash guardrails and choose remove current restriction. The same menu can also make a session read-only while it's running.

26. Commands from this video

Here are the commands and shortcuts from this video. Come back here whenever you need a reminder.

27. Let's practice!

Now it's your turn to try these controls in CoCo.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.