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()
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.
Inherited Members
- cmd.Cmd
- Cmd
- precmd
- postcmd
- postloop
- parseline
- onecmd
- completedefault
- completenames
- complete
- get_names
- complete_help
- print_topics
- columnize
- databased.dbshell.DBShell
- default
- display
- do_add_column
- do_add_table
- do_backup
- do_customize
- do_dbpath
- do_delete
- do_describe
- do_drop_column
- do_drop_table
- do_dump
- do_flush_log
- do_help
- do_new_db
- do_properties
- do_query
- do_rename_column
- do_rename_table
- do_restore
- do_scan
- do_schema
- do_script
- do_select
- do_set_connection_timeout
- do_set_detect_types
- do_set_enforce_foreign_keys
- do_size
- do_tables
- do_update
- do_use
- do_vacuum
- do_views
- preloop
- argshell.argshell.ArgShell
- do_quit
- do_sys
- cmdloop
- emptyline