MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / _ensure_col

Function _ensure_col

Scripts/ButSystem.py:738–758  ·  view source on GitHub ↗

_ensure_col. Internal helper function. This docstring was expanded to make future maintenance easier. Args: table: Parameter. col: Parameter. ddl: Parameter. Returns: Varies.

(table: str, col: str, ddl: str)

Source from the content-addressed store, hash-verified

736This docstring was added automatically to improve maintainability.
737
738Returns:
739 Varies.
740"""
741 return datetime.utcnow().isoformat(timespec="seconds") + "Z"
742
743def db_init():
744 """db_init.
745
746Database helper for connecting to or initializing the SQLite database.
747
748This docstring was expanded to make future maintenance easier.
749
750Returns:
751 Varies.
752"""
753 conn = db_connect()
754 cur = conn.cursor()
755
756 cur.execute("""
757 CREATE TABLE IF NOT EXISTS users (
758 id INTEGER PRIMARY KEY AUTOINCREMENT,
759 username TEXT UNIQUE NOT NULL,
760 pw_hash TEXT NOT NULL,
761 is_admin INTEGER NOT NULL DEFAULT 0,

Callers 1

db_initFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected