hckr configure¶
Easy configurations for other commands (eg. db)
hckr configure [OPTIONS] COMMAND [ARGS]...
db¶
This command configures database credentials based on the selected database type.
Hint
We currently support Postgres, MySql, Sqlite and Snowflake,
Please feel free to raise an issue or Pull request if additional databases are needed.
1 |
Postgres |
2 |
Mysql |
3 |
Sqlite |
4 |
Snowflake |
Example Usage:
Setting up your database configuration using Prompt values
$ hckr configure db
Note
Using this cli will ask for information like database host, port, username etc. as per the database type selected.
Similarly, we can also provide all values using flag
$ hckr configure db --config-name test-config --database-type 3 --database-name mydb.sqlite
Note
here, we have configured Sqlite database with a name ‘mydb.sqlite’ by providing both flags in command line,
for other database types, we will have to provide required flags accordingly.
Command Reference:
hckr configure db [OPTIONS]
Options
- --config-name <config_name>¶
Name of the config instance
- --database-type <database_type>¶
Database type
- Options:
1 | 2 | 3 | 4
- --host <host>¶
Database host
- --port <port>¶
Database port
- --user <user>¶
Database user
- --password <password>¶
Database password
- --database-name <database_name>¶
Database name
- --schema <schema>¶
Database schema
- --account <account>¶
Snowflake Account Id
- --warehouse <warehouse>¶
Snowflake warehouse
- --role <role>¶
Snowflake role
- -f, --config-path <config_path>¶
Config file path, default:
~/.hckrcfg
set-default¶
Set the default configuration for a service configured via hckr configure
This command configures database credentials based on the selected database type.
Hint
We currently support database default configuration which corresponds to hckr configure,
Example Usage:
Setting up your default database configuration in [DEFAULT] configuration
$ hckr configure set-default db MY_DB_CONFIG
Note
Please note that the MY_DB_CONFIG config must be configured before running this using hckr configure db command
Important
This command will add an entry in [DEFAULT] configuration like database = MY_DB_CONFIG and
if you run any database command like hckr db query <QUERY> without providing configuration using
-c/--config flag this config will be used.
Command Reference:
hckr configure set-default [OPTIONS] {database} CONFIG_NAME
Options
- -f, --config-path <config_path>¶
Config file path, default:
~/.hckrcfg
Arguments
- SERVICE¶
Required argument
- CONFIG_NAME¶
Required argument