Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

docs: use instead of (#2312)

Danny Xu9e4afd1fdfb9
diff --git a/api/repository.go b/api/repository.go
index 95f431dbf2..ae1651ea78 100644
--- a/api/repository.go
+++ b/api/repository.go
@@ -68,7 +68,7 @@ type RepositoryCreate struct {
ExternalID string `jsonapi:"attr,externalId"`
// Token belonged by the user linking the project to the VCS repository. We store this token together
// with the refresh token in the new repository record so we can use it to call VCS API on
- // behalf of that user to perform tasks like webhook CRUD later.
+ // behalf of that user to perform tasks such as webhook CRUD later.
AccessToken string `jsonapi:"attr,accessToken"`
ExpiresTs int64 `jsonapi:"attr,expiresTs"`
RefreshToken string `jsonapi:"attr,refreshToken"`
diff --git a/api/sql.go b/api/sql.go
index 88f850791b..924aa3a4a8 100644
--- a/api/sql.go
+++ b/api/sql.go
@@ -31,7 +31,7 @@ type SQLSyncSchema struct {
// For now, we only support readonly / SELECT.
type SQLExecute struct {
InstanceID int `jsonapi:"attr,instanceId"`
- // For engines like MySQL, databaseName can be empty.
+ // For engines such as MySQL, databaseName can be empty.
DatabaseName string `jsonapi:"attr,databaseName"`
Statement string `jsonapi:"attr,statement"`
// For now, Readonly must be true
diff --git a/api/task.go b/api/task.go
index 2a8d73886a..97d77e154c 100644
--- a/api/task.go
+++ b/api/task.go
@@ -208,7 +208,7 @@ type TaskCreate struct {
PipelineID int
StageID int
InstanceID int `jsonapi:"attr,instanceId"`
- // Tasks like creating database may not have database.
+ // Tasks such as creating database may not have database.
DatabaseID *int `jsonapi:"attr,databaseId"`
// Domain specific fields
diff --git a/common/log/logger.go b/common/log/logger.go
index 48da35ec54..0ed3eab522 100644
--- a/common/log/logger.go
+++ b/common/log/logger.go
@@ -9,8 +9,8 @@ import (
var (
// `gl` is the global logger.
- // Other packages should use public methods like Info/Error to do the logging.
- // If special logging is required (like log to a separate file for some special operations), we need to add other loggers.
+ // Other packages should use public methods such as Info/Error to do the logging.
+ // For other types of logging, e.g. logging to a separate file, they should use their own loggers.
gl *zap.Logger
gLevel zap.AtomicLevel
)
diff --git a/common/util.go b/common/util.go
index b2bdd97385..3f48584043 100644
--- a/common/util.go
+++ b/common/util.go
@@ -78,7 +78,7 @@ func DefaultMigrationVersion() string {
// For example, if the template is "{{DB_NAME}}_hello_{{LOCATION}}", then the tokens will be ["{{DB_NAME}}", "{{LOCATION}}"],
// and the delimiters will be ["_hello_"].
// The caller will usually replace the tokens with a normal string, or a regexp. In the latter case, it will be a problem
-// if there are special regexp characters like "$" in the delimiters. The caller should escape the delimiters in such cases.
+// if there are special regexp characters such as "$" in the delimiters. The caller should escape the delimiters in such cases.
func ParseTemplateTokens(template string) ([]string, []string) {
r := regexp.MustCompile(`{{[^{}]+}}`)
tokens := r.FindAllString(template, -1)
diff --git a/docs/api-style-guide.md b/docs/api-style-guide.md
index 75db84935a..2a50d508d4 100644
--- a/docs/api-style-guide.md
+++ b/docs/api-style-guide.md
@@ -14,7 +14,7 @@ Most of the time, we only want to do partial update on the resource, and we shou
## Use resource id for addressing the specific resource
-Bytebase uses auto incremental ID as the primary key for all resources. To address a particular resource, we use GET `/issue/42`, if we want to support other addressing mechanism like using resource name, we should use query parameter like `.issue/42?name=foo`
+Bytebase uses auto-incremental ID as the primary key for all resources. To address a particular resource, we use GET `/issue/42`. If we want to support other addressing mechanism, we should use query parameters such as `.issue/42?name=foo`
## Use lower case, kebab-case for phrases
diff --git a/docs/design/pipeline.md b/docs/design/pipeline.md
index 94bc66a1a6..e06ea9128d 100644
--- a/docs/design/pipeline.md
+++ b/docs/design/pipeline.md
@@ -48,8 +48,8 @@ A PIPELINE consists of multiple STAGES. A STAGE consists of multiple TASKS.
# General design consideration
- Other mainstream products either have 3 or 4 layers.
- We choose 3 layers omitting the most granular layer - Step. For now only GitLab has 4 layer systems
- and its step is mostly used to model a lightweight step like shell script step. This seems like
+ We choose 3 layers omitting the most granular layer - Step. For now only GitLab has 4 layer systems,
+ and its step is mostly used to model a lightweight step similar to shell script step. This seems like
an overkill for our case. On the other hand, 3 layer design such as Octopus seems to be sufficient.
- All products agree on the smallest querable execution unit (having a dedicated API resource endpoint):
@@ -75,6 +75,6 @@ To wrap up, we finally arrive the same conclusion as spinnaker.
# Domain specific design consideration
-- We require a stage to associate with an environment. In the future, we will introduce environment tiers which define rules like whether requires manual approval.
+- We require a stage to associate with an environment. In the future, we will introduce environment tiers which define rules such as requiring manual approval.
-- We require a task to associate with an database instance. This limits the task usage to database operations instead of general purpose task management. Since Bytebase is dealing with database domain, this tradeoff is fine. On the other hand, a task may or may not contain a database since tasks like creating new database, syncing the entire instance schema are not database specific.
+- We require a task to associate with an database instance. This limits the task usage to database operations instead of general purpose task management. Since Bytebase is dealing with database domain, this tradeoff is fine. On the other hand, a task may or may not contain a database since tasks such as creating new database, syncing the entire instance schema are not database specific.
diff --git a/docs/design/pitr-mysql.md b/docs/design/pitr-mysql.md
index bf0c2dce3b..7dc2adba3b 100644
--- a/docs/design/pitr-mysql.md
+++ b/docs/design/pitr-mysql.md
@@ -96,7 +96,7 @@ The full backup process seems very sophisticated. Why don't we just dump the log
If we start to dump a logical backup called bk at time t, and the backup SQL runs for 10s and finishes at t+10. Then we get the binlog coordinates at t+10 and save it together with the backup metadata. When we want to do a PITR to the database state at t+20, we would restore the logical backup bk and replay the binlog from t+10 to t+20.
-Here is the problem: the logical backup is a [consistent read](https://dev.mysql.com/doc/refman/8.0/en/innodb-consistent-read.html) of the database, which means that no matter how long it takes to run the SQL, **the backup content is just like reading a snapshot of the database at time t**.
+Here is the problem: the logical backup is a [consistent read](https://dev.mysql.com/doc/refman/8.0/en/innodb-consistent-read.html) of the database, which means that no matter how long it takes to run the SQL, **the backup content is similar to a snapshot of the database at time t**.
Now let's reconsider the binlog replay. After the logical backup bk is restored, the database is at the state of t. If we want to incrementally restore to t+20, we should replay the binlog from **t to t+20** instead of t+10 to t+20 as is described above. In short, this "simpler implementation" is actually buggy.
@@ -119,7 +119,7 @@ To accomplish the tasks described above, Bytebase will embed the newest version
When the backup is enabled for a specific database, Bytebase will check where the PITR requirements are met and automatically upgrade to PITR and download the binlog files.
-An example command is like this, and the `--ssl` parameters should be used [following the doc](https://dev.mysql.com/doc/refman/5.7/en/mysqlbinlog.html#option_mysqlbinlog_ssl) if required:
+Take a look at an example command below. The `--ssl` parameters should be used [following the doc](https://dev.mysql.com/doc/refman/5.7/en/mysqlbinlog.html#option_mysqlbinlog_ssl) if required:
`mysqlbinlog mysql-bin.000001 --ssl=0 --read-from-remote-server --host=x --user=x --password=x --raw --result-file=/bytebase/binlog/`
@@ -144,7 +144,7 @@ When the point-in-time t1 is determined, Bytebase will take a series of actions
1. Abort the recovery will delete the pitr database.
2. Execute the cutover: if the original database exists, rename the original database to old, and rename the pitr database to the original; if not exists, we just create the pitr table using the user-provided name.
-The timeline involved above could be roughly represented like this:
+The timeline involved above could be roughly represented as:
(bk (t0), data changes, t1, data changes)
The pitr database naming convention in step 2 is appending _pitr_${UNIX_TIMESTAMP} to the end of the original database name. We must check that the pitr database name does not contain more than 64 characters, which is [the limit of MySQL](https://dev.mysql.com/doc/refman/8.0/en/identifier-length.html).
@@ -153,7 +153,7 @@ Step 6b uses a special MySQL syntax [`RENAME TABLE current_db.tbl_name TO other_
After the recovery process described above, Bytebase will ask for the user’s manual approval to delete the old database.
-To restore binlog from the original to the pitr table as is described in step 4, Bytebase will use the [`--rewrite-db`](https://dev.mysql.com/doc/refman/8.0/en/mysqlbinlog.html#option_mysqlbinlog_rewrite-db) option. An example is like `mysqlbinlog --rewrite-db='dbtarget->dbtarget_pitr' --database=dbtarget_pitr binlog.00001`. The `--database` option filters changed database names, so should not use the original database name.
+To restore binlog from the original to the pitr table as is described in step 4, Bytebase will use the [`--rewrite-db`](https://dev.mysql.com/doc/refman/8.0/en/mysqlbinlog.html#option_mysqlbinlog_rewrite-db) option. An example will be `mysqlbinlog --rewrite-db='dbtarget->dbtarget_pitr' --database=dbtarget_pitr binlog.00001`. The `--database` option filters changed database names, so should not use the original database name.
The database session used to accomplish this recovery task should disable binlog. The binlog is used as incremental backups of the database, and the recovery operation itself will also introduce data changes, which are actually a duplicate of the recovered data changes. We should prevent the duplicate from going into the incremental backups, i.e., the binlog.
@@ -176,7 +176,7 @@ When taking a backup of a database, now we also need to store the current positi
To provide a search option with the timestamp and binlog position, we will encode both of them, where the timestamp is the time at which the statement began executing on the MySQL server and decoded from the [binlog event header](https://dev.mysql.com/doc/internals/en/event-header-fields.html). The timestamp is represented as the UNIX timestamp, i.e., the number of seconds since 1970 (UTC).
-An example of the PITR information is like this:
+An example of the PITR information will be:
```json
{
diff --git a/docs/dev-guide.md b/docs/dev-guide.md
index 99a332d746..477f671674 100644
--- a/docs/dev-guide.md
+++ b/docs/dev-guide.md
@@ -50,7 +50,7 @@ git push --set-upstream origin feat/xxx
### Branch Naming Convention
-The recommended branch naming convention is using `/` as a namespace separator, e.g., feat/xxx, chore/xxx, docs/xxx, which works nicely with 3rd party git tools like GitLens.
+The recommended branch naming convention is using `/` as a namespace separator, e.g., feat/xxx, chore/xxx, docs/xxx, which works nicely with 3rd party git tools such as GitLens.
diff --git a/enterprise/service/license.go b/enterprise/service/license.go
index 11d5cfcb96..329f4712f5 100644
--- a/enterprise/service/license.go
+++ b/enterprise/service/license.go
@@ -20,7 +20,7 @@ type LicenseService struct {
}
// Claims creates a struct that will be encoded to a JWT.
-// We add jwt.RegisteredClaims as an embedded type, to provide fields like name.
+// We add jwt.RegisteredClaims as an embedded type, to provide fields such as name.
type Claims struct {
InstanceCount int `json:"instanceCount"`
Trialing bool `json:"trialing"`
diff --git a/frontend/src/bbkit/BBTooltipButton.vue b/frontend/src/bbkit/BBTooltipButton.vue
index 69c9276f58..3ddc2a058c 100644
--- a/frontend/src/bbkit/BBTooltipButton.vue
+++ b/frontend/src/bbkit/BBTooltipButton.vue
@@ -2,7 +2,7 @@
<NTooltip trigger="manual" :show="state.tooltipVisible">
<template #trigger>
<!--
- <button disabled> will swallow all mouse related events like mouseover/mouseout...
+ <button disabled> will swallow all mouse related events such as mouseover/mouseout...
so we need to handle it manually with lower level DOM pointer events
-->
<button
diff --git a/frontend/src/plugins/types.ts b/frontend/src/plugins/types.ts
index 50fe040f69..de4da3d09b 100644
--- a/frontend/src/plugins/types.ts
+++ b/frontend/src/plugins/types.ts
@@ -45,7 +45,7 @@ export type InputField = {
// is very similar to the message field id in Protocol Buffers.
id: FieldId;
// Used as the key to generate UI artifacts (e.g. query parameter).
- // Though changing it won't have catastrophic consequence like changing
+ // Though changing it won't have catastrophic consequence such as changing
// id, we strongly recommend NOT to change it as well, otherwise, previous
// generated artifacts based on this info such as URL would become invalid.
slug: string;
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 6e9e10494b..20685c47b4 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -259,7 +259,7 @@ const routes: Array<RouteRecordRaw> = [
// perspective, they are more familiar with the "user" concept.
// We make an exception to use a shorthand here because it's a commonly
// accessed endpoint, and maybe in the future, we will further provide a
- // shortlink like u/<<uid>>
+ // shortlink such as u/<<uid>>
path: "u/:principalId",
name: "workspace.profile",
meta: {
diff --git a/frontend/src/store/modules/task.ts b/frontend/src/store/modules/task.ts
index af6a17cf58..8f2502fdb5 100644
--- a/frontend/src/store/modules/task.ts
+++ b/frontend/src/store/modules/task.ts
@@ -165,7 +165,7 @@ function convertPartial(
}
if (
item.type == "database" &&
- // Tasks like creating database may not have database.
+ // Tasks such as creating database may not have database.
(task.relationships!.database.data as ResourceIdentifier)?.id == item.id
) {
database = databaseStore.convert(item, includedList);
diff --git a/frontend/src/types/pipeline/task.ts b/frontend/src/types/pipeline/task.ts
index 59f6b586c4..37397e2ba1 100644
--- a/frontend/src/types/pipeline/task.ts
+++ b/frontend/src/types/pipeline/task.ts
@@ -136,7 +136,7 @@ export type Task = {
type: TaskType;
instance: Instance;
earliestAllowedTs: number;
- // Tasks like creating database may not have database.
+ // Tasks such as creating database may not have database.
database?: Database;
payload?: TaskPayload;
diff --git a/plugin/advisor/mysql/advisor_migration_compatibility.go b/plugin/advisor/mysql/advisor_migration_compatibility.go
index 19f22d03d4..5cd70961e0 100644
--- a/plugin/advisor/mysql/advisor_migration_compatibility.go
+++ b/plugin/advisor/mysql/advisor_migration_compatibility.go
@@ -131,7 +131,7 @@ func (v *compatibilityChecker) Enter(in ast.Node) (ast.Node, bool) {
// Due to the limitation that we don't know the current data type of the column before the change,
// so we treat all as incompatible. This generates false positive when:
// 1. Change to a compatible data type such as INT to BIGINT
- // 2. Change property like comment, change it to NULL
+ // 2. Change properties such as comment, change it to NULL
if spec.Tp == ast.AlterTableModifyColumn || spec.Tp == ast.AlterTableChangeColumn {
code = advisor.CompatibilityAlterColumn
break
diff --git a/plugin/advisor/sql_review.go b/plugin/advisor/sql_review.go
index 21a04bb6ef..a51415ba91 100644
--- a/plugin/advisor/sql_review.go
+++ b/plugin/advisor/sql_review.go
@@ -227,7 +227,7 @@ func UnmarshalNamingRulePayloadAsTemplate(ruleType SQLReviewRuleType, payload st
// For example, if the template is "{{DB_NAME}}_hello_{{LOCATION}}", then the tokens will be ["{{DB_NAME}}", "{{LOCATION}}"],
// and the delimiters will be ["_hello_"].
// The caller will usually replace the tokens with a normal string, or a regexp. In the latter case, it will be a problem
-// if there are special regexp characters like "$" in the delimiters. The caller should escape the delimiters in such cases.
+// if there are special regexp characters such as "$" in the delimiters. The caller should escape the delimiters in such cases.
func parseTemplateTokens(template string) ([]string, []string) {
r := regexp.MustCompile(`{{[^{}]+}}`)
tokens := r.FindAllString(template, -1)
diff --git a/server/jwt.go b/server/jwt.go
index 606f6e0ca9..bd0c9a6e6c 100644
--- a/server/jwt.go
+++ b/server/jwt.go
@@ -47,7 +47,7 @@ const (
)
// Claims creates a struct that will be encoded to a JWT.
-// We add jwt.RegisteredClaims as an embedded type, to provide fields like name.
+// We add jwt.RegisteredClaims as an embedded type, to provide fields such as name.
type Claims struct {
Name string `json:"name"`
jwt.RegisteredClaims
diff --git a/server/metric_reporter.go b/server/metric_reporter.go
index c79e61c4ab..6e55a24cc5 100644
--- a/server/metric_reporter.go
+++ b/server/metric_reporter.go
@@ -79,7 +79,7 @@ func (m *MetricReporter) Run(ctx context.Context, wg *sync.WaitGroup) {
}()
ctx := context.Background()
- // identify will be triggered in every schedule loop so that we can update the latest workspace profile like subscription plan.
+ // identify will be triggered in every schedule loop so that we can update the latest workspace profile such as subscription plan.
m.identify(ctx)
for name, collector := range m.collectors {
log.Debug("Run metric collector", zap.String("collector", name))
diff --git a/store/backup.go b/store/backup.go
index 620943782a..36983d76ba 100644
--- a/store/backup.go
+++ b/store/backup.go
@@ -34,7 +34,7 @@ type backupRaw struct {
MigrationHistoryVersion string
Path string
Comment string
- // Payload contains data like PITR info, which will not be created at first.
+ // Payload contains data such as PITR info, which will not be created at first.
// When backup runner executes the real backup job, it will fill this field.
Payload api.BackupPayload
}