Skip to content

Commit 5f7598e

Browse files
committed
text: change "instance" to "database server" for consistency
This commit tweaks the wording of logging, help text, and error messages to prefer "database server" instead of "instance". Previously, a mix of these two terms was used, which could cause confusion. We now prefer "database server" (or equivalently "DB server") to refer to a copy of MySQL Server or MariaDB Server running on a specific host and port. Although "instance" is common terminology on cloud vendors ("RDS instance", "CloudSQL instance", etc) overall that term seems less clear because e.g. an "EC2 instance" can also be the client side / where Skeema runs from. This change is being made now ahead of a planned new documentation page, which will cover core concepts and terminology. A few places intentionally still use "instance" even after this commit: * The concurrent-instances option for `skeema push` remains as-is for backwards compatibility. * The "-- instance: ..." comment in STDOUT output of `skeema diff` and `skeema push` remains as-is, since some users parse this text. * Some internal-only error messages still use "instance", since the internal struct type tengo.Instance isn't being renamed. The first two might change in a future major-version bump (e.g. Skeema v2) if/when that happens, but no concrete plans at this time. This commit also adjusts some other unrelated help text, for example now preferring "command-line arg" over "CLI arg".
1 parent a483a70 commit 5f7598e

File tree

12 files changed

+37
-37
lines changed

12 files changed

+37
-37
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Skeema supports a pull-request-based workflow for schema change submission, revi
1717

1818
## Products and downloads
1919

20-
This repo is the free open source Community edition of the Skeema CLI. The Community edition supports management of [**tables**](https://www.skeema.io/docs/features/tables/) and [**routines**](https://www.skeema.io/docs/features/routines/) (procs/funcs). Builds are provided for Linux and MacOS.
20+
This repo is the free open source Community edition of the Skeema command-line tool. The Community edition supports management of [**tables**](https://www.skeema.io/docs/features/tables/) and [**routines**](https://www.skeema.io/docs/features/routines/) (procs/funcs). Builds are provided for Linux and MacOS.
2121

2222
The paid [Premium edition](https://www.skeema.io/download/) of the Skeema CLI adds support for managing [**views**](https://www.skeema.io/docs/features/views/), [**triggers**](https://www.skeema.io/docs/features/triggers/), and [**events**](https://www.skeema.io/docs/features/events/). It also includes a native **Windows build**, built-in [**SSH tunnel**](https://www.skeema.io/docs/features/ssh/) functionality, [**seed data**](https://www.skeema.io/docs/features/seeddata/) management, and many other improvements.
2323

@@ -27,7 +27,7 @@ For download links and more information, visit [skeema.io](https://www.skeema.io
2727

2828
Page | Description
2929
--- | ---
30-
[Installation](https://www.skeema.io/docs/install/) | How to install the CLI
30+
[Installation](https://www.skeema.io/docs/install/) | How to install the Skeema CLI tool
3131
[Getting started](https://www.skeema.io/docs/examples/) | Usage examples and screencasts
3232
[Requirements](https://www.skeema.io/docs/requirements/) | Supported database systems and required database privileges
3333
[Features](https://www.skeema.io/docs/features/) | How Skeema interacts with each type of database object, and various feature-specific topics
@@ -37,7 +37,7 @@ Page | Description
3737
[Schema change workflow](https://www.skeema.io/docs/workflow/) | Recommended flow for pull-request-driven schema changes
3838
[Pipelines and automation](https://www.skeema.io/docs/automation/) | Integrating Skeema into automated workflows
3939
[Recipes](https://www.skeema.io/docs/recipes/) | Using Skeema to achieve common schema management tasks
40-
[FAQ](https://www.skeema.io/docs/faq/) | Frequently asked questions about the Skeema CLI
40+
[FAQ](https://www.skeema.io/docs/faq/) | Frequently asked questions about Skeema
4141

4242
## Credits
4343

cmd_add_env.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ func AddEnvHandler(cfg *mybase.Config) error {
5555
// that checks connectivity.
5656
var inst *tengo.Instance
5757
if !cfg.OnCLI("host") {
58-
return NewExitValue(CodeBadConfig, "`skeema add-environment` requires --host to be supplied on CLI")
58+
return NewExitValue(CodeBadConfig, "`skeema add-environment` requires --host to be supplied on command-line")
5959
}
6060
if instances, err := dir.Instances(); err != nil {
6161
return err
6262
} else if len(instances) == 0 {
63-
return NewExitValue(CodeBadConfig, "Command line did not specify which instance to connect to")
63+
return NewExitValue(CodeBadConfig, "Sharding configuration for host (or host-wrapper) yielded an empty list of database servers")
6464
} else {
6565
inst = instances[0]
6666
}

cmd_diff.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
)
66

77
func init() {
8-
summary := "Compare a DB instance's schemas to the filesystem"
9-
desc := "Compares the schemas on database instance(s) to the corresponding filesystem " +
8+
summary := "Compare a DB server's schemas to the filesystem"
9+
desc := "Compares the schemas on database server(s) to the corresponding filesystem " +
1010
"representation of them. The output is a series of DDL commands that, if run on " +
11-
"the instance, would cause the instances' schemas to now match the definitions " +
11+
"the DB server, would cause its schemas to now match the definitions " +
1212
"from the filesystem.\n\n" +
13-
"You may optionally pass an environment name as a CLI arg. This will affect " +
13+
"You may optionally pass an environment name as a command-line arg. This will affect " +
1414
"which section of .skeema config files is used for processing. For example, " +
1515
"running `skeema diff staging` will apply config directives from the " +
1616
"[staging] section of config files, as well as any sectionless directives at the " +
@@ -46,7 +46,7 @@ func clonePushOptionsToDiff() {
4646
descRewrites := map[string]string{
4747
"allow-unsafe": "Permit generating ALTER or DROP operations that are potentially destructive",
4848
"alter-wrapper": "Output ALTER TABLEs as shell commands rather than just raw DDL; see manual for template vars",
49-
"brief": "Don't output DDL to STDOUT; instead output list of instances with at least one difference",
49+
"brief": "Don't output DDL to STDOUT; instead output list of database servers with at least one difference",
5050
"safe-below-size": "Always permit generating destructive operations for tables below this size in bytes",
5151
}
5252
hiddenRewrites := map[string]bool{

cmd_format.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ func init() {
1515
summary := "Normalize format of filesystem representation of database objects"
1616
desc := "Reformats the filesystem representation of database objects to match the canonical " +
1717
"format shown in SHOW CREATE.\n\n" +
18-
"This command relies on accessing database instances to test the SQL DDL in a " +
18+
"This command relies on accessing a database server to test the SQL DDL in a " +
1919
"temporary location. See the --workspace option for more information.\n\n" +
20-
"You may optionally pass an environment name as a CLI arg. This will affect " +
20+
"You may optionally pass an environment name as a command-line arg. This will affect " +
2121
"which section of .skeema config files is used for workspace selection. For " +
2222
"example, running `skeema format staging` will " +
2323
"apply config directives from the [staging] section of config files, as well as " +

cmd_init.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import (
1414
)
1515

1616
func init() {
17-
summary := "Save a DB instance's schemas to the filesystem"
18-
desc := "Creates a filesystem representation of the schemas on a DB instance. " +
19-
"For each schema on the instance (or just the single schema specified by " +
17+
summary := "Save a DB server's schemas to the filesystem"
18+
desc := "Creates a filesystem representation of the schemas on a database server. " +
19+
"For each schema on the DB server (or just the single schema specified by " +
2020
"--schema), a subdir with a .skeema config file will be created. Each directory " +
2121
"will be populated with .sql files containing CREATE statements for every " +
2222
"table and routine in the schema.\n\n" +
23-
"You may optionally pass an environment name as a CLI arg. This will affect " +
23+
"You may optionally pass an environment name as a command-line arg. This will affect " +
2424
"which section of .skeema config files the host-related options are written to. " +
2525
"For example, running `skeema init staging` will add config directives to the " +
2626
"[staging] section of config files. If no environment name is supplied, the " +
@@ -74,7 +74,7 @@ func InitHandler(cfg *mybase.Config) error {
7474
if err != nil {
7575
return err
7676
} else if inst == nil {
77-
return NewExitValue(CodeBadConfig, "Command line did not specify which instance to connect to")
77+
return NewExitValue(CodeBadConfig, "Command line did not specify which database server to connect to")
7878
}
7979

8080
// Build list of schemas
@@ -87,7 +87,7 @@ func InitHandler(cfg *mybase.Config) error {
8787
return NewExitValue(CodeFatalError, "Cannot examine schemas on %s: %s", inst, err)
8888
}
8989
if onlySchema != "" && len(schemas) == 0 {
90-
return NewExitValue(CodeBadConfig, "Schema %s does not exist on instance %s", onlySchema, inst)
90+
return NewExitValue(CodeBadConfig, "Schema %s does not exist on database server %s", onlySchema, inst)
9191
}
9292

9393
// Write host option file

cmd_lint.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func init() {
2121
"generate an error, a warning, or be ignored entirely. Statements that contain " +
2222
"invalid SQL, or otherwise return an error from the database, are always flagged " +
2323
"as linter errors.\n\n" +
24-
"By default, this command also reformats statements to their canonical form, " +
24+
"By default, this command also reformats CREATE statements to their canonical form, " +
2525
"just like `skeema format`.\n\n" +
26-
"This command relies on accessing database instances to test the SQL DDL in a " +
26+
"This command relies on accessing a database server to test the SQL DDL in a " +
2727
"temporary location. See the --workspace option for more information.\n\n" +
28-
"You may optionally pass an environment name as a CLI arg. This will affect " +
28+
"You may optionally pass an environment name as a command-line arg. This will affect " +
2929
"which section of .skeema config files is used for linter configuration and " +
3030
"workspace selection. For example, running `skeema lint staging` will " +
3131
"apply config directives from the [staging] section of config files, as well as " +

cmd_pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import (
1616
func init() {
1717
summary := "Update the filesystem representation of schemas"
1818
desc := "Updates the existing filesystem representation of the schemas on a DB " +
19-
"instance. Use this command when changes have been applied to the database " +
19+
"server. Use this command when changes have been applied to the database " +
2020
"manually or outside of Skeema, in order to make the filesystem representation " +
2121
"reflect those changes.\n\n" +
22-
"You may optionally pass an environment name as a CLI arg. This will affect " +
22+
"You may optionally pass an environment name as a command-line arg. This will affect " +
2323
"which section of .skeema config files is used for processing. For example, " +
2424
"running `skeema pull staging` will apply config directives from the " +
2525
"[staging] section of config files, as well as any sectionless directives at the " +

cmd_push.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import (
1515

1616
func init() {
1717
summary := "Alter objects on DBs to reflect the filesystem representation"
18-
desc := "Modifies the schemas on database instance(s) to match the corresponding " +
18+
desc := "Modifies the schemas on database server(s) to match the corresponding " +
1919
"filesystem representation of them. This essentially performs the same diff logic " +
2020
"as `skeema diff`, but then actually runs the generated DDL. You should generally " +
2121
"run `skeema diff` first to see what changes will be applied.\n\n" +
22-
"You may optionally pass an environment name as a CLI arg. This will affect " +
22+
"You may optionally pass an environment name as a command-line arg. This will affect " +
2323
"which section of .skeema config files is used for processing. For example, " +
2424
"running `skeema push staging` will apply config directives from the " +
2525
"[staging] section of config files, as well as any sectionless directives at the " +
@@ -62,9 +62,9 @@ func init() {
6262
)
6363

6464
cmd.AddOptions("sharding",
65-
mybase.BoolOption("first-only", '1', false, "For dirs mapping to multiple instances or schemas, just run against the first per dir"),
65+
mybase.BoolOption("first-only", '1', false, "For dirs mapping to multiple hosts or schemas, only run against the first target per dir"),
6666
mybase.BoolOption("brief", 'q', false, "<overridden by diff command>").Hidden(),
67-
mybase.StringOption("concurrent-instances", 'c', "1", "Perform operations on this number of instances concurrently"),
67+
mybase.StringOption("concurrent-instances", 'c', "1", "Perform operations on this number of database servers concurrently"),
6868
)
6969

7070
workspace.AddCommandOptions(cmd)

internal/applier/target.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func instancesForDir(dir *fs.Dir) (instances []*tengo.Instance, skipCount int) {
120120
if dir.Config.GetBool("first-only") {
121121
onlyInstance, err := dir.FirstInstance()
122122
if onlyInstance == nil && err == nil {
123-
log.Warnf("Skipping %s: directory maps to an empty list of instances", dir)
123+
log.Warnf("Skipping %s: directory maps to an empty list of database servers", dir)
124124
if dir.Config.Changed("host-wrapper") {
125125
log.Warnf("The host-wrapper option controls which hosts this directory maps to, but the executed script returned no hostnames.\n")
126126
}
@@ -139,7 +139,7 @@ func instancesForDir(dir *fs.Dir) (instances []*tengo.Instance, skipCount int) {
139139
log.Errorf("Skipping %s: %s\n", dir, err)
140140
return nil, 1
141141
} else if len(rawInstances) == 0 {
142-
log.Warnf("Skipping %s: directory maps to an empty list of instances", dir)
142+
log.Warnf("Skipping %s: directory maps to an empty list of database servers", dir)
143143
if dir.Config.Changed("host-wrapper") {
144144
log.Warnf("The host-wrapper option controls which hosts this directory maps to, but the executed script returned no hostnames.\n")
145145
}
@@ -175,7 +175,7 @@ func targetsForLogicalSchema(logicalSchema *fs.LogicalSchema, dir *fs.Dir, insta
175175
for _, other := range instances[1:] {
176176
if compare := other.NameCaseMode(); compare != tengo.NameCaseUnknown && compare != lctn {
177177
log.Errorf("Skipping %s: all database servers mapped by the same subdirectory and environment must have the same value for lower_case_table_names.", dir)
178-
log.Errorf("Instance %s has lower_case_table_names=%d, but instance %s has lower_case_table_names=%d.", instances[0], lctn, other, compare)
178+
log.Errorf("Database server %s has lower_case_table_names=%d, while %s has lower_case_table_names=%d.", instances[0], lctn, other, compare)
179179
return nil, len(instances)
180180
}
181181
}

internal/fs/dir.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func (dir *Dir) FirstInstance() (*tengo.Instance, error) {
356356
if len(instances) == 1 {
357357
return nil, fmt.Errorf("Unable to connect to %s for %s: %s", instances[0], dir, lastErr)
358358
}
359-
return nil, fmt.Errorf("Unable to connect to any of %d instances for %s; last error %s", len(instances), dir, lastErr)
359+
return nil, fmt.Errorf("Unable to connect to any of %d database servers for %s; last error %s", len(instances), dir, lastErr)
360360
}
361361

362362
// ValidateInstance confirms the supplied instance is (or has been) reachable,
@@ -385,13 +385,13 @@ func (dir *Dir) ValidateInstance(instance *tengo.Instance) error {
385385
confFlavor := tengo.ParseFlavor(dir.Config.Get("flavor"))
386386
if instFlavor.Known() {
387387
if confFlavor != tengo.FlavorUnknown && instFlavor.Family() != confFlavor.Family() && !dir.Config.OnCLI("flavor") {
388-
log.Warnf("Instance %s actual flavor %s differs from dir %s configured flavor %s\nIf you have recently upgraded your database server version, consider using `skeema pull` to update your schema definitions.", instance, instFlavor, dir, confFlavor)
388+
log.Warnf("Database server %s actual flavor %s differs from dir %s configured flavor %s\nIf you have recently upgraded your database server version, consider using `skeema pull` to update your schema definitions.", instance, instFlavor, dir, confFlavor)
389389
}
390390
if instFlavor.TooNew() {
391-
log.Warnf("Instance %s flavor %s is newer than this version of Skeema. To ensure correct behavior, consider upgrading to a more recent release of Skeema.", instance, instFlavor)
391+
log.Warnf("Database server %s flavor %s is newer than this version of Skeema. To ensure correct behavior, consider upgrading to a more recent release of Skeema.", instance, instFlavor)
392392
}
393393
} else if confFlavor.Known() {
394-
log.Debugf("Instance %s flavor cannot be parsed; using dir %s configured flavor %s instead", instance, dir, confFlavor)
394+
log.Debugf("Database server %s flavor cannot be parsed; using dir %s configured flavor %s instead", instance, dir, confFlavor)
395395
instance.SetFlavor(confFlavor)
396396
} else {
397397
log.Warnf(`Unable to determine database server vendor/version of %s. To set manually, use the "flavor" option in %s`, instance, filepath.Join(dir.Path, ".skeema"))

0 commit comments

Comments
 (0)