Skip to content

Commit 77c25b1

Browse files
authored
chore: migrate bytebase api (#96)
* chore: use set for unordered collection * chore: update doc * fix: list all databases in the project * chore: update * fix: lint * chore: add databases for instance * chore: more error log * chore: update * chore: update * feat: database resource * fix: lint * feat: support semantic type setting * fix: lint * chore: update * chore: database name list in instance and project * chore: update docs * chore: migrate bytebase api * chore: mod tidy * fix: test
1 parent 1a42921 commit 77c25b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+70
-243
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.16
1+
1.0.17

api/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type Client interface {
6464
// GetDatabaseCatalog gets the database catalog by the database full name.
6565
GetDatabaseCatalog(ctx context.Context, databaseName string) (*v1pb.DatabaseCatalog, error)
6666
// UpdateDatabaseCatalog patches the database catalog.
67-
UpdateDatabaseCatalog(ctx context.Context, patch *v1pb.DatabaseCatalog, updateMasks []string) (*v1pb.DatabaseCatalog, error)
67+
UpdateDatabaseCatalog(ctx context.Context, patch *v1pb.DatabaseCatalog) (*v1pb.DatabaseCatalog, error)
6868

6969
// Project
7070
// GetProject gets the project by project full name.

client/database.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ func (c *client) GetDatabaseCatalog(ctx context.Context, databaseName string) (*
147147
}
148148

149149
// UpdateDatabaseCatalog patches the database catalog.
150-
func (c *client) UpdateDatabaseCatalog(ctx context.Context, patch *v1pb.DatabaseCatalog, updateMasks []string) (*v1pb.DatabaseCatalog, error) {
151-
body, err := c.updateResource(ctx, patch.Name, patch, updateMasks, false /* allow missing = false*/)
150+
func (c *client) UpdateDatabaseCatalog(ctx context.Context, patch *v1pb.DatabaseCatalog) (*v1pb.DatabaseCatalog, error) {
151+
body, err := c.updateResource(ctx, patch.Name, patch, nil, false /* allow missing = false*/)
152152
if err != nil {
153153
return nil, err
154154
}

docs/data-sources/group.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ The group data source.
2121

2222
### Read-Only
2323

24-
- `create_time` (String) The group create time in YYYY-MM-DDThh:mm:ss.000Z format
25-
- `creator` (String) The group creator in users/{email} format.
2624
- `description` (String) The group description.
2725
- `id` (String) The ID of this resource.
2826
- `members` (Set of Object) The members in the group. (see [below for nested schema](#nestedatt--members))

docs/data-sources/group_list.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ The group data source list.
2525

2626
Read-Only:
2727

28-
- `create_time` (String)
29-
- `creator` (String)
3028
- `description` (String)
3129
- `members` (Set of Object) (see [below for nested schema](#nestedobjatt--groups--members))
3230
- `name` (String)

docs/data-sources/project.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ The project data source.
2727
- `databases` (Set of String) The databases full name in the resource.
2828
- `enforce_issue_title` (Boolean) Enforce issue title created by user instead of generated by Bytebase.
2929
- `id` (String) The ID of this resource.
30-
- `key` (String) The project key.
3130
- `members` (Set of Object) The members in the project. (see [below for nested schema](#nestedatt--members))
3231
- `name` (String) The project full name in projects/{resource id} format.
3332
- `postgres_database_tenant_mode` (Boolean) Whether to enable the database tenant mode for PostgreSQL. If enabled, the issue will be created with the pre-appended "set role <db_owner>" statement.

docs/data-sources/project_list.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Read-Only:
3434
- `auto_resolve_issue` (Boolean)
3535
- `databases` (Set of String)
3636
- `enforce_issue_title` (Boolean)
37-
- `key` (String)
3837
- `members` (Set of Object) (see [below for nested schema](#nestedobjatt--projects--members))
3938
- `name` (String)
4039
- `postgres_database_tenant_mode` (Boolean)

docs/data-sources/vcs_connector.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ The vcs connector data source.
2626

2727
### Read-Only
2828

29-
- `create_time` (String) The vcs connector create time in YYYY-MM-DDThh:mm:ss.000Z format
30-
- `creator` (String) The vcs connector creator in users/{email} format.
3129
- `id` (String) The ID of this resource.
3230
- `name` (String) The vcs connector full name in projects/{project}/vcsConnector/{resource id} format.
3331
- `repository_branch` (String) The connected repository branch in vcs provider.
@@ -36,8 +34,6 @@ The vcs connector data source.
3634
- `repository_path` (String) The connected repository path in vcs provider.
3735
- `repository_url` (String) The connected repository url in vcs provider.
3836
- `title` (String) The vcs connector title.
39-
- `update_time` (String) The vcs connector update time in YYYY-MM-DDThh:mm:ss.000Z format
40-
- `updater` (String) The vcs connector updater in users/{email} format.
4137
- `vcs_provider` (String) The vcs provider full name in vcsProviders/{resource id} format.
4238

4339

docs/data-sources/vcs_connector_list.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ The vcs connector data source list.
2929

3030
Read-Only:
3131

32-
- `create_time` (String)
33-
- `creator` (String)
3432
- `database_group` (String)
3533
- `name` (String)
3634
- `project` (String)
@@ -41,8 +39,6 @@ Read-Only:
4139
- `repository_url` (String)
4240
- `resource_id` (String)
4341
- `title` (String)
44-
- `update_time` (String)
45-
- `updater` (String)
4642
- `vcs_provider` (String)
4743

4844

docs/resources/group.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ The group resource. Workspace domain is required for creating groups.
2727

2828
### Read-Only
2929

30-
- `create_time` (String) The group create time in YYYY-MM-DDThh:mm:ss.000Z format
31-
- `creator` (String) The group creator in users/{email} format.
3230
- `id` (String) The ID of this resource.
3331
- `name` (String) The group name in groups/{email} format.
3432
- `source` (String) Source means where the group comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID.

0 commit comments

Comments
 (0)