[Owncloud] Database access for apps.
Côme BERNIGAUD
come.bernigaud at laposte.net
Sat Aug 27 20:29:48 UTC 2011
Well, I'd say we only need db.php and the db folder (look at
https://github.com/laravel/laravel/tree/master/system )
License is Public Domain.
Dependences seems to be
https://github.com/laravel/laravel/blob/master/system/paginator.php and
https://github.com/laravel/laravel/blob/master/system/inflector.php .
str.php also
Nothing too big imo, but we should look at multiple solutions before to
make a choice. (bartv was suggesting doctrine on the irc channel)
Côme
Le 27/08/2011 21:35, Jakob Sack a écrit :
> Hi,
>
> I aggree with you that it is bad to have these constructs in the code.
> At work I program a lot with Ruby on Rails and like their approach of
> handling queries very much. Having a look at the framework you propose
> it looks like it does it exactly the same way. Is there a way to
> extract these features? I don't think we want to use the rest of the
> framework ...
> Cheers,
>
> Jakob
>
>
> On Sat, 27 Aug 2011 17:23:17 +0200, Côme BERNIGAUD wrote:
>> What about this kind of things :
>> http://laravel.com/docs/database/query ?
>> I'd like to avoid things like "if( $CONFIG_DBTYPE == 'sqlite' or
>> $CONFIG_DBTYPE == 'sqlite3' ){" in owncloud code.
>> (That's from the bookmark app, btw)
>>
>> Côme.
>>
>> Le 26/08/2011 19:15, Frank Karlitschek a écrit :
>>> I agree.
>>> We should provide a clean API, including one for database access,
>>> for our Apps.
>>>
>>> Cheers
>>> Frank
>>>
>>> On 26.08.2011, at 18:56, Côme BERNIGAUD wrote:
>>>
>>>> I think owncloud should provide an API for accessing databases in
>>>> the apps code.
>>>> Apps code should not contain any SQL code.
>>>> An app should be able to easily store and retrieve information
>>>> linked to the current user.
>>>> "I, docsapp, want to save that the connected user have this object
>>>> with this properties"
>>>>
>>>> Basically the app should be able to do something like objectid =
>>>> OC_Database::store(userid,id) (the object would be serialized to be
>>>> inserted in the database)
>>>> And then OC_Database::get_object(objectid) and
>>>> OC_Database::get_objectsids(userid)
>>>> Maybe all these should takes as first parameter the name of the
>>>> app. (so that it use a separate base/table for each app)
>>>>
>>>> This should preferably work both from PHP and Javascript.
>>>>
>>>> Côme.
>>>> _______________________________________________
>>>> Owncloud mailing list
>>>> Owncloud at kde.org
>>>> https://mail.kde.org/mailman/listinfo/owncloud
>>> Frank Karlitschek
>>> karlitschek at kde.org
>>>
>>>
>> _______________________________________________
>> Owncloud mailing list
>> Owncloud at kde.org
>> https://mail.kde.org/mailman/listinfo/owncloud
>
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud
More information about the Owncloud
mailing list