user_created = hc.create_user(
user_name = "test_user",
pwd = "password123"
)
Result:
This method returns a Boolean value to represent whether this operation is successful. If the error pops up when creating user, “ValueError” exception will be raised.
Parameter description:
Parameters | Description | Options |
---|---|---|
user_name (str) | New username | Yes |
password (str) | New password | Yes |
is_super (bool) | Whether this user is superuser | No, defaults to False |
can_create_role (bool) | Whether this user can create role | No, defaults to False |
can_create_db (bool) | Whether this user can create database | No, defaults to False |