Re: [Django] #14845: Document connection-creation process

34 views
Skip to first unread message

Django

unread,
Mar 25, 2021, 3:13:36 AM3/25/21
to django-...@googlegroups.com
#14845: Document connection-creation process
-----------------------------------+------------------------------------
Reporter: Christophe Pettus | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Carlton Gibson):

#32589 was a duplicate ref documenting the need for calling
close_old_connections in long-running management commands.

Ostensibly this ticket here is about connection creation, but (a decade
later) a general overview of the connection life-cycle would be a nice
improvement.

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

Django

unread,
Mar 25, 2021, 11:55:14 AM3/25/21
to django-...@googlegroups.com
#14845: Document connection-creation process
-----------------------------------+------------------------------------
Reporter: Christophe Pettus | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by GwynBleidD):

* cc: GwynBleidD (added)


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

Django

unread,
Mar 30, 2022, 4:24:21 AM3/30/22
to django-...@googlegroups.com
#14845: Document connection-creation process
-----------------------------------+------------------------------------
Reporter: Christophe Pettus | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by dcontador):

Whoever takes this should remember to document `close_old_connections`
([https://code.djangoproject.com/ticket/32589]).

--
Ticket URL: <https://code.djangoproject.com/ticket/14845#comment:13>

Django

unread,
Apr 3, 2023, 5:32:45 AM4/3/23
to django-...@googlegroups.com
#14845: Document connection-creation process
-------------------------------------+-------------------------------------
Reporter: Christophe Pettus | Owner: Akshat
| verma
Type: New feature | Status: assigned

Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Akshat verma):

* status: new => assigned
* cc: Akshat verma (added)
* needs_better_patch: 0 => 1
* easy: 0 => 1
* owner: nobody => Akshat verma
* needs_docs: 0 => 1
* has_patch: 0 => 1
* ui_ux: 0 => 1


Old description:

> Currently, the actual database connection is created on-demand when a
> cursor is requested. This is great for standard use, but there are
> occasional uses where it would be handy to have the connection open
> before requesting a cursor (for example, if you are doing a raw SQL query
> using the cursor(cursor_factory=) syntax.
>
> The proposal here is to move the connection-creation mechanism to a
> separate public method that both the internal cursor-creation mechanism
> and a client of the connection object could call.

New description:

Currently, the actual database connection is created on-demand when a
cursor is requested. This is great for standard use, but there are
occasional uses where it would be handy to have the connection open before
requesting a cursor (for example, if you are doing a raw SQL query using
the cursor(cursor_factory=) syntax.

The proposal here is to move the connection-creation mechanism to a
separate public method that both the internal cursor-creation mechanism
and a client of the connection object could call.

# in settings.py

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {
'service': 'my_service',
'passfile': '.my_pgpass',
},
}
}

#in .pg_service.conf

[my_service]
host=localhost
user=USER
dbname=NAME
port=5432

#in .my_pgpass

localhost:5432:NAME:USER:PASSWORD

--

Comment:

#changes by Akshat verma
# in settings.py

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'OPTIONS': {
'service': 'my_service',
'passfile': '.my_pgpass',
},
}
}

#in .pg_service.conf

[my_service]
host=localhost
user=USER
dbname=NAME
port=5432

#in .my_pgpass

localhost:5432:NAME:USER:PASSWORD

--
Ticket URL: <https://code.djangoproject.com/ticket/14845#comment:14>

Django

unread,
Apr 3, 2023, 5:44:52 AM4/3/23
to django-...@googlegroups.com
#14845: Document connection-creation process
-----------------------------------+------------------------------------
Reporter: Christophe Pettus | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

Akshat, again, please stop to change ticket descriptions and put random
information that is neither helpful nor related with the ticket.

Django

unread,
Apr 3, 2023, 7:02:27 AM4/3/23
to django-...@googlegroups.com
#14845: Document connection-creation process
-----------------------------------+------------------------------------
Reporter: Christophe Pettus | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Akshat verma):

Replying to [comment:14 Mariusz Felisiak]:
> Okay but I unable to get your comments. And due to lack of some
information I did so
And one thing I want to say that the changes commit by me was quite
genuine but I the place I made was wrong so you must suggest me the rigth
file path in the GitHub repository.

--
Ticket URL: <https://code.djangoproject.com/ticket/14845#comment:15>

Django

unread,
Apr 3, 2023, 7:07:26 AM4/3/23
to django-...@googlegroups.com
#14845: Document connection-creation process
-------------------------------------+-------------------------------------
Reporter: Christophe Pettus | Owner: Akshat
| verma
Type: New feature | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Akshat verma):

* owner: nobody => Akshat verma
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/14845#comment:16>

Django

unread,
Apr 3, 2023, 7:13:37 AM4/3/23
to django-...@googlegroups.com
#14845: Document connection-creation process
-------------------------------------+-------------------------------------
Reporter: Christophe Pettus | Owner: Akshat
| verma
Type: New feature | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:15 Akshat verma]:


> Replying to [comment:14 Mariusz Felisiak]:
> > Okay but I unable to get your comments. And due to lack of some
information I did so
> And one thing I want to say that the changes commit by me was quite

genuine but I the place I made was wrong so you must suggest me the right


file path in the GitHub repository.

Please don't edit my comments, you're behavior is really inappropriate. I
left at least a few comments with gentle requests before I started
cleaning up after you. If you want to contribute and need help you should
start from [https://docs.djangoproject.com/en/4.2/internals/contributing/
reading docs] and eventually asking questions on
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
support channels]. Are you really going to work on 10 tickets at once?
Again, I'd recommend picking one ticket and starting with that.

--
Ticket URL: <https://code.djangoproject.com/ticket/14845#comment:17>

Django

unread,
Jul 28, 2023, 1:40:58 PM7/28/23
to django-...@googlegroups.com
#14845: Document connection-creation process
-------------------------------------+-------------------------------------
Reporter: Christophe Pettus | Owner: Pradhvan
| Bisht

Type: New feature | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Pradhvan Bisht ):

* owner: nobody => Pradhvan Bisht


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/14845#comment:14>

Reply all
Reply to author
Forward
0 new messages