Skip to main content

Snowflake の新エディタ: プライベートワークスペースと共有ワークスペース)

Snowflake では、ワークスペースと呼ばれる新しいファイルエディタが導入されました。
これにより、フォルダによるファイル整理が容易になります。データベースエクスプローラーとクエリ履歴ペインも搭載されているため、データベースオブジェクトの探索やクエリの検査も容易になります。

ワークスペースには、(プライベート) ワークスペースと共有ワークスペースの 2 種類があります。

(プライベート) ワークスペース

  1. ワークスペース所有者専用(所有者のみがワークスペースファイルを表示およびアクセスできます)。
  2. ワークスペースは、自動的に作成されるユーザー固有のデータベースに保存されます。このデータベースには、プライベートワークスペースのみが保存され、それ以外のファイルは保存されません。
  3. あらゆる種類のファイル(SQL ファイル、Python ファイル、JavaScript、シェルファイルなど)を作成できます。
  4. フォルダの作成とネストが可能です。ファイルのドラッグ&ドロップも可能です。
  5. AI Copilot が有効になっています。
  6. バージョン管理(git、github)を使用してバージョン履歴を管理できます。

まもなく、ワークスペースはSnowflakeのデフォルトエディターになります。

共有ワークスペース

プライベートワークスペースと同じですが、2つの違いがあります。

  1. 共有ワークスペースは、テーブルなどの他のオブジェクトも保存する通常のデータベース上に作成できます。
    ワークスペースの作成者は、ワークスペースを作成するデータベースとスキーマを選択できます。
  2. 共有ワークスペースには複数のユーザーがアクセスできます。アクセスはロールによって管理されます。
    あるユーザーが共有ワークスペースのファイルを変更すると、他のユーザーもそれを閲覧できます。
    ユーザーは、自分のプライベートワークスペースからファイルを共有ワークスペースに持ち込むことができます。

使用方法

共有ワークスペースエディターは、リアルタイムのマルチユーザー編集をサポートしていません。
あるユーザーがファイルの編集を開始すると、そのファイルのコピーが下書きとして取得されます。変更内容はそのユーザーのみに表示されます。変更されたファイルを公開すると、他のユーザーにも変更内容が表示されます。

ファイルやフォルダのアップロード、名前変更、削除などの変更は、公開する必要はありません。

ファイルを公開する前に、「差分を表示」機能を使用して、下書きと最新の公開バージョンを比較できます。

共有ワークスペースには、すべてのバージョン履歴が保存されます。ファイルの古いバージョンを確認したり、ファイルを以前のバージョンに戻したりすることができます。

基本的に、共有ワークスペースのワークフローは Gitのワークフローと非常に似ています。

  • ユーザーは、他のチームメンバーに変更内容を表示するには、変更を公開(プッシュ)する必要があります。
  • ユーザー A がファイルを編集しているときに、ユーザー B が同じファイルを変更してプッシュした場合、ユーザー A が変更を公開しようとすると競合が発生する可能性があります。
  • ワークスペースにはバージョン履歴が保存されており、古いバージョンを復元できます。

権限とアクセス制御

共有ワークスペースでは、ロールベースのアクセス制御が使用されます。

共有ワークスペースを作成するには、ロールに以下のいずれかの権限が必要です。

  • データベースとスキーマに対する「USAGE」権限と「CREATE WORKSPACE」権限
  • 対象スキーマに対する「OWNERSHIP」権限

共有ワークスペースへのアクセスの付与と取り消し

ワークスペースへのアクセスの付与と取り消しは、GUI と SQL コマンドの両方で行うことができます。

グラフィカルユーザーインターフェース:

「Configure workspace」設定を使用して、ロールを追加および削除し、それらのロールに共有ワークスペースへのアクセスを付与または取り消すことができます。

SQL コマンドを使用する場合:

GRANT WRITE ON WORKSPACE <workspace_name> TO ROLE <role_name>;

REVOKE WRITE ON WORKSPACE <workspace_name> FROM ROLE <role_name>;

ロールには、WRITE 権限に加えて、共有ワークスペースが配置されているデータベースに対する USAGE 権限も必要です。

Comments

Popular posts from this blog

Introduction to SQLFluff: How to make your SQL code clean and error-free

Image by Jake Aldridge from Pixabay You know oftentimes, the cause of runtime or compile errors and hours of debugging agony is all due to simply a missing semicolon. Have you ever had such experience? If you had, you are not alone. There are two ways to avoid these unfortunate situations: either become a perfect developer who never makes mistakes, or use helpful tools such as linters that can catch these errors early on. I am nowhere near being a perfect developer who never makes a mistake. In fact, I'm probably the opposite of a perfect developer, so even if I wanted to, I wouldn’t be able to teach you how to become a perfect developer. But what I can teach you is using linters. A Wikipedia defines a linter as a "static code analysis tool used to flag programming errors, bugs, stylistic errors and suspicious constructs." If you're not convinced yet on using linters, consider this scenario: in a large project with multiple members, different people tend to ...

Git squash merge explained

There are many ways to integrate changes in git: regular / normal git merge, git squash merge, git rebase etc. This article explains git squash merge by comparing it to regular merge. Let’s use below example: In the repository with default main branch, after two commits, a new feature branch is created. Some work happened in feature branch. feature branch now has 2 commits that it shares with main branch, and three exclusive commits (exists only in feature branch). In the meantime, others worked on main branch and added two new commits (exists only in main branch). git log output of the main branch: c72d4a9 ( HEAD - > main ) fourth commit on main 2c3dd61 third commit on main 0c2eec3 second commit on main 9b968e8 first commit on main git log output of the feature branch: 786650f ( HEAD - > feature ) third commit on feature 21cbaf1 second commit on feature 677bc7f first commit on feature 0c2eec3 second commit on main 9b968e8 first commit on mai...

How To Use KeePassXC Cli

There are similarly named programs: KeePass, KeePassX and KeePassXC (many of which are each others’ forks). Program Condition KeePass primarily for Windows. KeePassX no longer actively maintained. KeePassXC actively maintained and runs natively on Linux, macOS and Windows . Note: GUI version of the KeePassXC has more features than cli version. GUI version has variety of shortcuts as well. Regarding how to use GUI version of the KeePassXC, visit Getting Started Guide . Below features are available only in GUI version. Setting “Name” and “Description” fields of passwords database. Nesting Groups. Creating entry attributes ( open issue ). Adding Timed One-Time Passwords (TOTP). Adding entry with the same title as existing entry. KeePassXC stores all the passwords in passwords database. A passwords database (hereafter referred to as database) is an (encrypted) binary file. It can have any or no extension, but the .kdbx extension is commonly used. The ...