Skip to content

Conversation

@dimitri-yatsenko
Copy link
Member

Summary

Remove dj.kill() and dj.kill_quick() — database administration utilities that don't belong in a data pipeline library.

Closes #1347

Reasoning

  1. Outside DataJoint's scope — DataJoint is for defining schemas and managing scientific data pipelines, not database administration

  2. Better alternatives exist

    Tool Capability
    Direct SQL SHOW PROCESSLIST; KILL <pid>; (MySQL)
    CLI tools mysqladmin processlist, mysqladmin kill
    GUI tools MySQL Workbench, pgAdmin, DBeaver, DataGrip
    Cloud consoles AWS RDS, Azure, GCP dashboards
  3. Implementation had issues

    • Interactive input() prompts — unusable in scripts/automation
    • SQL injection vulnerability via string interpolation
    • MySQL-only — wouldn't work with PostgreSQL backend

Changes

  • Delete src/datajoint/admin.py
  • Remove kill from __all__ and _lazy_modules in __init__.py
  • Remove related test in test_lazy_imports.py

Migration

Users should use native database tools:

-- MySQL
SHOW PROCESSLIST;
KILL 1234;

-- PostgreSQL  
SELECT pid, usename, state, query FROM pg_stat_activity;
SELECT pg_terminate_backend(1234);

Test plan

  • Unit tests pass (137 passed)

🤖 Generated with Claude Code

Remove database connection management functions that don't belong in a
data pipeline library.

Closes #1347

Reasoning:
- Outside DataJoint's scope (data pipelines, not DB administration)
- Better tools exist (native SQL, CLI tools, GUIs, cloud consoles)
- Implementation had issues (interactive prompts, SQL injection risk)
- MySQL-only, wouldn't work with PostgreSQL backend

Users can use native database tools instead:
- MySQL: SHOW PROCESSLIST; KILL <pid>;
- PostgreSQL: SELECT * FROM pg_stat_activity; SELECT pg_terminate_backend(pid);

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the enhancement Indicates new improvements label Jan 24, 2026
Dead code - class was defined but never instantiated anywhere.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Indicates new improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dj.kill and dj.kill_quick

2 participants