I will happily cede ground to people who actually use stored procedures. On 23 October 2014 04:14, Carl Meyer <[email protected]> wrote:
> > > On Oct 22, 2014, at 5:56 PM, Shai Berger <[email protected]> wrote: > >> On Wednesday 22 October 2014 19:35:49 Carl Meyer wrote: > >>> On 10/21/2014 04:04 PM, Shai Berger wrote: > >>> I'd argue that in the common case, the user shouldn't care if the > >>> function they are calling is implemented in Python or Procedural SQL > >>> (assuming it is going to interact with the database either way), and so > >>> it is good API design to abstact this detail away. > >> > >> Here is where we differ. I think calling a database stored procedure is > >> fundamentally a different thing from calling a Python function (even one > >> that accesses the database), and the difference should be obvious in the > >> calling code. I don't think it is good API design to abstract away > >> differences that the caller should be aware of. (For one example of a > >> difference, database stored procedures "return a modified copy of the > >> input arguments", which would be extremely unusual behavior for a normal > >> Python function.) > > That, of course, doesn't have to be the case for the wrapper API. > > Well, that's the problem, isn't it? A purpose-built nice Python wrapper > for a particular stored procedure can certainly do something better, but > I'm not sure what else a generic wrapper system could do. You don't know > which parameters to an arbitrary proc might be output parameters (unless > you try some kind of runtime introspection, or require a registration step > where the user tells you about the signature; at that point you may as well > just let the user write their own wrapper). There's a reason 'callproc' has > the odd signature it does. > > Carl > > -- > 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/6F8CC704-DB07-4220-AF85-EBF03BD0141C%40oddbird.net > . > 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/CAMwjO1Ht-3MMMTQoPDkm0ZvYBz595tm8NDBWHDNt3v9ofcGreA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
