I guess now with migrations we have a nice way of running the SQL against
the database to create the stored procedures.

However if we plan to make this a public API, it should be a nice one.
Something along the lines of db.procedures.proc_name(*args, **kwargs) would
be preferable I think. Obviously this requires more magic to make it work
(or explicit registration of your procedures).

Marc

On 19 October 2014 00:25, Shai Berger <[email protected]> wrote:

> Hi all,
>
> For a very long time -- as far as I'm aware, forever -- we've had, in our
> cursor classes, a "callproc()" method that follows the callproc()
> definition of
> pep249[1]; this allows database stored procedures to be called.
>
> Recently, we've had a ticket[2] and PR[3] to enhance this method -- the
> pep249
> definition takes the procedure name and a list of positional arguments;
> some
> database drivers (notably cx_Oracle) allow passing also a dictionary of
> named
> arguments, so we want to support that too. While reviewing the PR, we found
> that
>
> (a) cursor.callproc is not documented
> (b) cursor.callproc is not tested (except for one Oracle-specific test that
> uses it to test something else)
>
> Which means, essentially, that it is treated as an intenal API.
>
> I see no reason that we shouldn't make it public API -- but
>
> (a) I might be wrong
> (b) If we do, then we need to document it and test it on all supported
> backends (which implement it). I am not aware of any "universally
> available"
> stored procedure nor even universally valid syntax for creating stored
> procedures; so this probably amounts to backend-specific tests.
>
> So, I'm asking for advice.
>
> If there are no objections, I will open a ticket calling for the above, and
> try to coordinate the work on it with the work on #23546.
>
> Have fun,
>         Shai.
>
> [1] http://legacy.python.org/dev/peps/pep-0249/#callproc
> [2] https://code.djangoproject.com/ticket/23546
> [3] https://github.com/django/django/pull/3342
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers  (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/201410190225.34849.shai%40platonix.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMwjO1FkpLtcWpv9o7o_PXU%2BrN07Qop_QfmGHLEuY8hcpPnEPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to