* Sergi Almacellas Abellana [2017-03-21 12:02 +0100]:
>El 20/03/17 a les 18:34, Nicolas Évrard ha escrit:
>>Hello,
>>
>>I am currently working on two patches that will make it easier to
>>create python modules adding a new backend to tryton:
>>
>> -
https://tryton-rietveld.appspot.com/33951002/ This patch moves
>> the handling of the SQL type of the tryton fields to the backend.
>>
>> In order to have a kind of lingua franca between tryton and the
>> backend we specify on the field the "abstract" SQL types it
>> wants to use (a M2O will use an INTEGER, a TimeDelta an
>> INTERVAL, and so on).
>
>So in order to create a custom field type (I have JSONB in my mind),
>we have to create a new backend? And in order to support this kind of
>fields on more than one backend we have to create multiple backend?
Kind of.
The lingua franca is a just a mean so that the fields speak the same
language as the backend. It's then up to the backend to translate this
for the database.
>I imagine some users having to maintain the following backends:
>
>sqlite+spatialite
>postgresql+postgis
>sqlite+json
>postgresql+jsonb
>sqlite+spatialite+json
>postgresql+postgist+json
I think that an eventual support for JSONB would be implemented using
JSONB for postgres, TEXT for sqlite and MySQL.
>Having said that I'm wondering if it won't be better to allow to
>register the handlers of the abstract types in external modules, so
>with the same backend we will be able to handle different types of
>fields, which can be then reused.
Indeed registering marshallers in the backends could be a way to
tackle the complexity of mixing together GIS and JSONB and whatnot.
>>
>> -
https://tryton-rietveld.appspot.com/26231002/
>> This patch uses the abstract SQL types to create the column in
>> the backend instead of the raw SQL type that was used before.
>>
>>You can see those patch in action in the following patch adding a
>>postgis backend which inherits almost everything from the postgres
>>backend:
https://codereview.appspot.com/322730043/
>
>Instead of creating a new backend I will prefer to extend the
>existing one.
There is not that much people using geographic related data, and even
in those cases it seems the geographic data is not use in business
processes.
That's why I think it should live in a specific package.
On the other hand JSONB could be and (probably will be) used in
business processes that's why I think that those kind of fields should
be included in core. So I am not completely sold on the idea of
registering marshallers in the end ;).
>>We wonder if there is some kind of interest to make this backend
>>supported by community or if we should keep it in the B2CK realm.
>>According to me we should definitely support this backend (I
>>personally know ∞-time more people that would use this backend then
>>the mysql one). And this last remarks makes me wonder if we shouldn't
>>make of the mysql backend this kind of python package (supported by
>>the community but not release critical at all).
>
>+1 for separating mysql backend.
OK then.
>I'm in favor of adding community supported packages but not release
>critical. Indeed, i think more packages can be added in this realm,
>like:
>
>- flask-tryton
>- celery-tryton
>- redis-tryton
>- trydoc
+1 but we should discuss of each of those separately.