#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018746762653-f62b9c1e-b1ca-4234-8558-55ef95e1708a-000000%40eu-central-1.amazonses.com.

Reply via email to