Initialize database connection. Args: db_path: Path to database file. Defaults to ~/.fastled/docker-compiler/compiler.db
(self, db_path: Optional[Path] = None)
| 42 | """Manages container lifecycle tracking database.""" |
| 43 | |
| 44 | def __init__(self, db_path: Optional[Path] = None): |
| 45 | """Initialize database connection. |
| 46 | |
| 47 | Args: |
| 48 | db_path: Path to database file. Defaults to ~/.fastled/docker-compiler/compiler.db |
| 49 | """ |
| 50 | if db_path is None: |
| 51 | home = Path.home() |
| 52 | db_dir = home / ".fastled" / "docker-compiler" |
| 53 | db_dir.mkdir(parents=True, exist_ok=True) |
| 54 | db_path = db_dir / "compiler.db" |
| 55 | |
| 56 | self.db_path = db_path |
| 57 | self._init_db() |
| 58 | |
| 59 | def _init_db(self) -> None: |
| 60 | """Initialize database schema.""" |