Re: Are there Sql backends that return an array from big_query()?

Henrik Grubbström <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Organization Roxen Internet Software AB
Message-ID <[email protected]>
On Thu, 30 Oct 2014, Stephen R. van den Berg wrote:

> Stephen R. van den Berg wrote:
>> Martin Nilsson (Opera Mini - AFK!) @ Pike (-) importm?te f?r mailinglistan wrote:
>>> I think the architecture is outdated, so instead it would be more
>>> valuable to look at how to make it properly. Instead of having a proxy
>>> object that calls a database object, there should be inheritance that
>>> allows direct calling when possible.
>
>> That's exactly what I was looking at, which is why I wanted to eliminate
>> big_query()s that return anything else than an object.

Sounds reasonable.

> I'm toying with something like this:
>
> Instantiate the .pike programs in the Sql.pmod directory using:
[...]
> As before, this to make sure that we have a driver.
>
> Then, instead of using the compiled program find_dbm returns, we do
> something along the lines of:
>
> program realclass =
> compile_string("inherit Sql.SQL;inherit Sql."+program_name+";");

I don't see a reason not to have the providers inherit the base 
API directly, now that it is reasonably easy to inherit Pike-code 
from modules written in C (cf Nettle and __builtin.Nettle).

> which then needs to be cached somewhere for repeated requests of the
> same dbtype, which can then be instantiated.

It shouldn't be a problem to use the master()->programs cache for this
(which would be automatic in the direct inherit case).

> Or is there some more direct way to create a new class out of two
> existing programs?

Not at Pike level.

-- 
Henrik Grubbström					[email protected]
Roxen Internet Software AB
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.