2023-07-17 16:48:50 -07:00
|
|
|
# Aliases
|
|
|
|
|
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
You can assign an alias to a Datasette instance using the `dclient alias add` command:
|
2023-07-17 16:48:50 -07:00
|
|
|
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
dclient alias add latest https://latest.datasette.io
|
2023-07-17 16:48:50 -07:00
|
|
|
|
|
|
|
|
You can list aliases with `dclient alias list`:
|
|
|
|
|
|
|
|
|
|
$ dclient alias list
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
latest = https://latest.datasette.io
|
2023-07-17 16:48:50 -07:00
|
|
|
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
Once registered, you can pass an alias to commands using the `-i` flag:
|
2023-07-17 16:48:50 -07:00
|
|
|
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
dclient query fixtures "select * from news limit 1" -i latest
|
|
|
|
|
|
2026-02-26 20:44:39 -08:00
|
|
|
See [Defaults](defaults.md) for default instance and default database settings.
|
2023-07-17 16:48:50 -07:00
|
|
|
|
|
|
|
|
## dclient alias --help
|
|
|
|
|
<!-- [[[cog
|
|
|
|
|
import cog
|
|
|
|
|
from dclient import cli
|
|
|
|
|
from click.testing import CliRunner
|
|
|
|
|
runner = CliRunner()
|
|
|
|
|
result = runner.invoke(cli.cli, ["alias", "--help"])
|
|
|
|
|
help = result.output.replace("Usage: cli", "Usage: dclient")
|
|
|
|
|
cog.out(
|
|
|
|
|
"```\n{}\n```".format(help)
|
|
|
|
|
)
|
|
|
|
|
]]] -->
|
|
|
|
|
```
|
|
|
|
|
Usage: dclient alias [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
|
|
|
|
Manage aliases for different instances
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2026-02-26 20:44:39 -08:00
|
|
|
add Add an alias for a Datasette instance
|
|
|
|
|
list List aliases
|
|
|
|
|
remove Remove an alias
|
2023-07-17 16:48:50 -07:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
<!-- [[[end]]] -->
|
|
|
|
|
|
|
|
|
|
## dclient alias list --help
|
|
|
|
|
|
|
|
|
|
<!-- [[[cog
|
|
|
|
|
import cog
|
|
|
|
|
result = runner.invoke(cli.cli, ["alias", "list", "--help"])
|
|
|
|
|
help = result.output.replace("Usage: cli", "Usage: dclient")
|
|
|
|
|
cog.out(
|
|
|
|
|
"```\n{}\n```".format(help)
|
|
|
|
|
)
|
|
|
|
|
]]] -->
|
|
|
|
|
```
|
|
|
|
|
Usage: dclient alias list [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List aliases
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--json Output raw JSON
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
<!-- [[[end]]] -->
|
|
|
|
|
|
|
|
|
|
## dclient alias add --help
|
|
|
|
|
|
|
|
|
|
<!-- [[[cog
|
|
|
|
|
import cog
|
|
|
|
|
result = runner.invoke(cli.cli, ["alias", "add", "--help"])
|
|
|
|
|
help = result.output.replace("Usage: cli", "Usage: dclient")
|
|
|
|
|
cog.out(
|
|
|
|
|
"```\n{}\n```".format(help)
|
|
|
|
|
)
|
|
|
|
|
]]] -->
|
|
|
|
|
```
|
|
|
|
|
Usage: dclient alias add [OPTIONS] NAME URL
|
|
|
|
|
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
Add an alias for a Datasette instance
|
2023-07-17 16:48:50 -07:00
|
|
|
|
2024-02-25 11:24:46 -08:00
|
|
|
Example usage:
|
|
|
|
|
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
dclient alias add prod https://myapp.datasette.cloud
|
2024-02-25 11:24:46 -08:00
|
|
|
|
2023-07-17 16:48:50 -07:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
<!-- [[[end]]] -->
|
|
|
|
|
|
|
|
|
|
## dclient alias remove --help
|
|
|
|
|
|
|
|
|
|
<!-- [[[cog
|
|
|
|
|
import cog
|
|
|
|
|
result = runner.invoke(cli.cli, ["alias", "remove", "--help"])
|
|
|
|
|
help = result.output.replace("Usage: cli", "Usage: dclient")
|
|
|
|
|
cog.out(
|
|
|
|
|
"```\n{}\n```".format(help)
|
|
|
|
|
)
|
|
|
|
|
]]] -->
|
|
|
|
|
```
|
|
|
|
|
Usage: dclient alias remove [OPTIONS] NAME
|
|
|
|
|
|
|
|
|
|
Remove an alias
|
|
|
|
|
|
2024-02-25 11:24:46 -08:00
|
|
|
Example usage:
|
|
|
|
|
|
Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.
Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.
Update aliases.md and authentication.md docs for v2 API.
refs #29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
|
|
|
dclient alias remove prod
|
2024-02-25 11:24:46 -08:00
|
|
|
|
2023-07-17 16:48:50 -07:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
<!-- [[[end]]] -->
|