Django

Code

Ticket #3461 (new)

Opened 2 years ago

Last modified 4 months ago

DatabaseWrapper should pass through args and kwargs to underlying database adapter

Reported by: Jack Moffitt <metajack@gmail.com> Assigned to: cgrady
Milestone: Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: metajack@gmai.com, ramiro Triage Stage: Accepted
Has patch: 1 Needs documentation: 1
Needs tests: 1 Patch needs improvement: 1

Description

Currently the DatabaseWrapper? (at least for the postgresql_psycopg2end) does not pass args and kwargs for cursor() calls to the underlying database adapter. This makes it impossible to use the adapter fully at the low level. For example, to use dict cursors in psycopg2 you have to pass a different cursor factory via the cursor_factory keyword argument to cursor(). The attached patch passes through args and kwargs for cursor() calls.

Attachments

psycopg2.diff (1.0 kB) - added by Jack Moffitt <metajack@gmail.com> on 02/08/07 14:39:14.
pass through args and kwargs for calls to cursor()
3461-cursor-options.patch (2.7 kB) - added by cgrady on 06/12/08 01:24:45.

Change History

02/08/07 14:39:14 changed by Jack Moffitt <metajack@gmail.com>

  • attachment psycopg2.diff added.

pass through args and kwargs for calls to cursor()

02/08/07 17:39:42 changed by Marc Fargas <telenieko@telenieko.com>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs changed.

07/14/07 13:20:22 changed by eliott@cactuswax.net

Any update on this? Would be very nice to not have to patch my working copy of the django libs, and so I can be more sure it will work on other installs.

12/01/07 08:28:25 changed by jacob

  • needs_better_patch set to 1.
  • stage changed from Design decision needed to Accepted.
  • needs_tests set to 1.
  • needs_docs set to 1.

A good idea -- orthogonal to DATABASE_OPTIONS added some time back -- but this needs to be done in a cross-database way, not just for one backend.

06/11/08 07:53:16 changed by Jack Moffitt <metajack@gmail.com>

  • cc set to metajack@gmai.com.

Sure, a cross database way would just be to apply the same style patch to other backends, no? Why not file a seperate bug for that project to replicate this patch on the other backends, instead of holding this one up until a perfect solution arrives.

06/12/08 01:24:45 changed by cgrady

  • attachment 3461-cursor-options.patch added.

08/22/08 11:49:49 changed by cgrady

  • owner changed from nobody to cgrady.

08/22/08 12:10:30 changed by mtredinnick

  • milestone set to 1.0 maybe.

08/22/08 19:45:30 changed by jacob

  • milestone changed from 1.0 maybe to post-1.0.

02/25/09 13:51:44 changed by

  • milestone deleted.

Milestone post-1.0 deleted

03/02/09 00:30:34 changed by mtredinnick

The current patch still needs documentation (topics/db/sql.txt would seem to be a reasonable location) and doesn't patch the SQLite or Oracle backends. Also, it should be possible to test this, at least in a backend-specific fashion (checking settings.DATABASE_ENGINE in the test). I'd like to see a test for at least one backend.

Whoever fixes it should have a "reasonable attempt" at the Oracle backend -- I realise testing that can be tricky, but we can get confirmation of correctness from other people before applying.

03/10/09 12:28:54 changed by ramiro

  • cc changed from metajack@gmai.com to metajack@gmai.com, ramiro.

Add/Change #3461 (DatabaseWrapper should pass through args and kwargs to underlying database adapter)




Change Properties
Action