sql-editor
folder for this tutorialsql-editor
demo appGoogleAuth
, and then click APIs & Services.
Web application
as the Application type, give it a Name.
http://localhost:8080/oauth/callback
and click CREATE.
Workspace Admin
role.
OAuth 2.0
as the Type, and Google
used as the template.
Service Account
as the Type, fill in the Email with super-api@service.bytebase.com
, choose Workspace Admin
as Roles, and click Confirm.sql-editor
demo appsql-editor
folder of the api-example
repository, and copy env-template.local
file as .env.local
. Replace the placeholders with yours.
pnpm i
and pnpm run dev
, you can run the demo app locally with localhost:3000
.
/v1/users/${email}
. If no user is found, it creates a new user with the email. The username is derived by removing the @
and .
symbols from the email.
/v1/projects/${username}
, if there is no project, it’ll create a new project with the username.
test-sample-instance
. First check if there is a database with that name using the API /v1/instances/test-sample-instance/databases/${username}
, if no, it’ll create a new database by creating an issue.
Typically, the issue creation process in Bytebase involves four steps: sheet -> plan -> issue -> rollout. However, for a database creation issue, it only includes three steps: plan -> issue -> rollout.
Project Owner
role.
First, fetch the project IAM using the API /v1/projects/${project}:getIamPolicy
. Then, add the new role to the array and update the IAM using the API /v1/projects/${project}:setIamPolicy
.