Skip to content

sahillhp/no-bacon-uvg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

121 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup:

python3 -m venv venv
pip install -r requirements.txt

Adding Commands

  1. Create your command file commands/ (commands/mycommand.py)

  2. Create your command function(s). Here's an example:

import psycopg
from typing import Any

def mycommand(conn: psycopg.Connection, args: list[str], ctx: dict[str, Any]):
    print(f"args: {args}")
    print(f"ctx: {ctx}")
    print(f"conn: {conn}")
  1. Then export the function(s) in commands/__init__.py
from .mycommand import mycommand
  1. Finally, add the function to the commands dictionary at the top of cli.py
CMDS: dict[str, Callable[[psycopg.Connection, list[str]], None]] = {
    # ...
    "mycommand": mycommand
    # ...
}

Connecting to the Database:

Make sure you have the .env file setup accordingly:

SSH_USER=********
SSH_PASSWORD=********
SSH_HOST=********
DB_USER=********
DB_PASSWORD=********
DB_HOST=********
DB_NAME=********
DB_PORT=********

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages