databased.customshell

 1from argshell import ArgShellParser, Namespace, with_parser
 2from pathier import Pathier
 3
 4from databased import Databased, dbparsers
 5from databased.dbshell import DBShell
 6
 7
 8class CustomShell(DBShell):
 9    _dbpath: Pathier = None  # Replace None with a path to a database file to set a default database # type: ignore
10    connection_timeout: float = 10
11    detect_types: bool = True
12    enforce_foreign_keys: bool = True
13    intro = "Starting customshell (enter help or ? for command info)..."
14    prompt = "customshell>"
15
16
17# For help with adding custom functionality see:
18# https://github.com/matt-manes/argshell
19# https://github.com/matt-manes/databased/blob/main/src/databased/dbshell.py
20# https://github.com/matt-manes/databased/blob/main/src/databased/dbparsers.py
21
22if __name__ == "__main__":
23    CustomShell().cmdloop()
class CustomShell(databased.dbshell.DBShell):
 9class CustomShell(DBShell):
10    _dbpath: Pathier = None  # Replace None with a path to a database file to set a default database # type: ignore
11    connection_timeout: float = 10
12    detect_types: bool = True
13    enforce_foreign_keys: bool = True
14    intro = "Starting customshell (enter help or ? for command info)..."
15    prompt = "customshell>"

Subclass this to create custom ArgShells.