﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35094	Add pure Python dbshell fallback	Jake Howard	nobody	"`dbshell` attempts to shell out to the client tooling for the relevant database engine (`sqlite3`, `psql` etc) for `dbshell`. If the tooling isn't installed, it can't shell. However, for a more naive shell implementation, it would be simple to pipe commands through to `connection.cursor().execute` and get at least some of the benefit without needing to install the client command-line tooling.

Whilst this wouldn't have the client-side magic (eg backslash commands in Postgres or `.` commands in sqlite), nor tab complete, it can still be a lot more useful than nothing. An implementation of this shipped in Python 3.12 for SQLite (https://github.com/python/cpython/blob/main/Lib/sqlite3/__main__.py), which can easily be adapted and made generic for all database engines.

Doing this has a side benefit of also giving support for a `dbshell` for in-memory SQLite connections, which are currently misleading through `dbshell`, as it doesn't reuse the same connection that Django does, meaning any database bootstrapping done during startup (best-practice aside) is lost. An in-process connection reuses the same connnection, and thus allows access to that in-memory database."	New feature	closed	Core (Management commands)	5.0	Normal	wontfix	sqlite dbshell in-memory		Unreviewed	1	0	0	0	0	0
