[Django] #30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database shell.

36 views
Skip to first unread message

Django

unread,
Oct 10, 2019, 8:24:27 AM10/10/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon | Owner: nobody
Charette |
Type: | Status: new
Cleanup/optimization |
Component: | Version: master
Documentation | Keywords: dbshell database
Severity: Normal | options
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
Some of `DATABASES['OPTIONS']` (e.g.
[https://docs.djangoproject.com/en/2.2/ref/databases/#isolation-level
isolation_level]) are not passed to the the underlying shell.

In the long run I think we should try to add support for as many as of
them as possible but since this will likely require and some time and
discussion we should at least document the limitation.

For context, we spent a good amount of trying to figure out why `SELECT
@@TX_ISOLATION` was returning a `REPEATABLE-READ` while we had set
`isolation_level = 'read committed'` in our `OPTIONS`.

I think it might be more discoverable if the a note was added beside
`DATABASES['OPTIONS']` instead of `dbshell`` as that's where we initially
looked but that's just anecdotal evidence.

--
Ticket URL: <https://code.djangoproject.com/ticket/30865>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 10, 2019, 9:10:34 AM10/10/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:1>

Django

unread,
Oct 21, 2019, 10:27:57 PM10/21/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned

Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Farhaan Bukhsh):

* owner: nobody => Farhaan Bukhsh
* status: new => assigned


Comment:

Hey, I would like to work on this issue. I might need some clarification
since I am a new contributor. Let me know if I am doing this right, adding
documentation saying some options might not be available around
`DATABASES['OPTIONS']` instead near `dbshell` will make it better, right?

Thanks for the help in advance. :joy:

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:2>

Django

unread,
Oct 21, 2019, 10:34:09 PM10/21/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

Hello Farhaan, thanks for giving a shot at this ticket!

I'm not sure where of the best place is for the documentation to live but
I have a slight preference for `dbshell` since I can't think of another
place where we special case ''connection'' creation and that was I looked
for when trying to figure out what was happening.

I guess a `..note` pointing to `DATABASE_OPTIONS` mentioning some options
will be ignored because should do.

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:3>

Django

unread,
Oct 21, 2019, 11:02:34 PM10/21/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Farhaan Bukhsh):

Hey Simon, thanks for replying :) I was thinking something similar may be
a list of all options which is not passed near the dbshell documentation.
What do you think?

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:4>

Django

unread,
Oct 22, 2019, 11:26:19 AM10/22/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

> I was thinking something similar may be a list of all options which is
not passed near the dbshell documentation. What do you think?

I think it will be hard to come up with this list for all backends and
maintain it over time as some of them are directly passed to the
underlying connector.

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:5>

Django

unread,
Oct 22, 2019, 11:32:39 PM10/22/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Farhaan Bukhsh):

Replying to [comment:5 Simon Charette]:


> > I was thinking something similar may be a list of all options which is
not passed near the dbshell documentation. What do you think?
>
> I think it will be hard to come up with this list for all backends and
maintain it over time as some of them are directly passed to the
underlying connector.

So I can just link dbshell with DATABASE_OPTIONS pointing out that some
options might be ignored

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:6>

Django

unread,
Oct 31, 2019, 2:34:50 AM10/31/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:7>

Django

unread,
Nov 5, 2019, 11:36:28 PM11/5/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Farhaan Bukhsh):

Hey Simon according to the documentation
https://docs.djangoproject.com/en/2.2/ref/databases/#isolation-
level%20isolation_level the default is `READ COMMITTED` so the behaviour
you should have got by default in dbshell should be `READ COMMITTED`, do
you think this is another bug or am I missing something?

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:8>

Django

unread,
Nov 5, 2019, 11:47:01 PM11/5/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

The MySQL server we were connecting to doesn't default to `READ COMMITTED`
hence why we used `DATABASES['OPTIONS']['isolation_level'] = 'read
committed'` to make sure connections managed by Django have their
isolation level set to the right value.

This option is ignored by `dbshell` which is the reason for this ticket's
existence.

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:9>

Django

unread,
Nov 7, 2019, 2:35:54 AM11/7/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"cc5622ec8c260535c63279cf6eb293f2b5a742f0" cc5622ec]:
{{{
#!CommitTicketReference repository=""
revision="cc5622ec8c260535c63279cf6eb293f2b5a742f0"
Fixed #30865 -- Doc'd that not all DATABASES['OPTIONS'] are passed to
command-line client.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:10>

Django

unread,
Nov 7, 2019, 2:35:58 AM11/7/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"64b01e38f9e2ac0362659968ddb8b65c6e0667a4" 64b01e38]:
{{{
#!CommitTicketReference repository=""
revision="64b01e38f9e2ac0362659968ddb8b65c6e0667a4"
[3.0.x] Fixed #30865 -- Doc'd that not all DATABASES['OPTIONS'] are passed
to command-line client.

Backport of cc5622ec8c260535c63279cf6eb293f2b5a742f0 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:11>

Django

unread,
Nov 7, 2019, 2:36:32 AM11/7/19
to django-...@googlegroups.com
#30865: Document that some DATABASES['OPTIONS'] are not passed to dbshell database
shell.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Farhaan
Type: | Bukhsh
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: dbshell database | Triage Stage: Accepted
options |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"398a9f42097ce2cbfc05de04d50c1ca18b68d542" 398a9f42]:
{{{
#!CommitTicketReference repository=""
revision="398a9f42097ce2cbfc05de04d50c1ca18b68d542"
[2.2.x] Fixed #30865 -- Doc'd that not all DATABASES['OPTIONS'] are passed
to command-line client.

Backport of cc5622ec8c260535c63279cf6eb293f2b5a742f0 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30865#comment:12>

Reply all
Reply to author
Forward
0 new messages