.. -*- coding: utf-8 -*-
.. :Project: metapensiero.sqlalchemy.proxy
.. :Created: gio 30 apr 2009 10:01:20 CEST
.. :Author: Lele Gaifax <lele@metapensiero.it>
.. :License: GNU General Public License version 3 or later
.. :Copyright: © 2009, 2010, 2012, 2013, 2014, 2016, 2017, 2018, 2020 Lele Gaifax
..
===============================
metapensiero.sqlalchemy.proxy
===============================
Expose SQLAlchemy's queries and their metadata to a webservice
==============================================================
:version: 5
:author: Lele Gaifax <lele@metapensiero.it>
:license: GPLv3
This package contains a few utilities to make it easier applying some filtering to a stock
query and obtaining the resultset in various formats.
See latest documentation at https://metapensierosqlalchemyproxy.readthedocs.io/en/latest/
Tests suite
-----------
The tests suite is based on ``tox`` and ``pytest``: to run it simply execute
::
$ make check
The ``PostgreSQL`` unit requires an existing database called ``mp_sa_proxy_test`` with the
``hstore`` extension, and that the current user can access it without password::
$ createdb mp_sa_proxy_test
$ psql -c "create extension hstore;" mp_sa_proxy_test
Changes
-------
5.14 (2020-04-25)
~~~~~~~~~~~~~~~~~
* Silently assume ASCending direction in sort criteria
5.13 (2020-02-08)
~~~~~~~~~~~~~~~~~
* Remove deprecated call to pyramid.i18n.get_localizer()
5.12 (2018-11-06)
~~~~~~~~~~~~~~~~~
* Fix deprecated import of abstract classed directly from the collections module
5.11 (2018-09-09)
~~~~~~~~~~~~~~~~~
* Fix deprecation warning related to collections abstract classes import
5.10 (2018-07-01)
~~~~~~~~~~~~~~~~~
* Fix failure extracting metadata of a column associated to a Sequence
5.9 (2018-07-01)
~~~~~~~~~~~~~~~~
* Rename the ``async`` module to ``asyncio`` for Python 3.7 compatibility
5.8 (2018-04-13)
~~~~~~~~~~~~~~~~
* Align the async layer with latest changes related to ``CompoundSelect`` support, now almost
complete
5.7 (2018-04-13)
~~~~~~~~~~~~~~~~
* Extend last fix to the Pyramid ``expose()`` decorator (yes, I know, I should *really* invest
some time in writing some tests for that...)
5.6 (2018-04-12)
~~~~~~~~~~~~~~~~
* Handle ``CompoundSelect`` such as ``SELECT 'foo' UNION SELECT 'bar'``
5.5 (2018-04-09)
~~~~~~~~~~~~~~~~
* Fix... last fix :-|
5.4 (2018-04-09)
~~~~~~~~~~~~~~~~
* Fix regression that broke using a generator as an expose() function
5.3 (2018-03-15)
~~~~~~~~~~~~~~~~
* The Pyramid ``expose()`` decorator now forwards unrecognized keyword arguments to the proxy
call
5.2 (2018-03-12)
~~~~~~~~~~~~~~~~
* Handle extraction of metadata from a ``BinaryExpression`` such as ``SELECT jsonfield['attr']``
5.1 (2018-03-08)
~~~~~~~~~~~~~~~~
* When a column has a *default* value, and it is directly computable (i.e. it is not a server
side default), then extract it into its metadata
5.0 (2017-07-22)
~~~~~~~~~~~~~~~~
.. warning:: This release **breaks** backward compatibility in several ways!
* More versatile way to add/override basic metadata information (see
``register_sa_type_metadata()``)
* More versatile way to use different JSON library or encode/decode settings (see
``register_json_decoder_encoder()``): although the default implementation is still based on
nssjson__, it is *not* required by default anymore at install time
* Basic metadata changed:
- the `width` slot for all fields is gone, it's more reasonably computed by the actual UI
framework in use: it was rather arbitrary anyway, and set to ``length * 10`` for String
columns
- the `length` slot is present only for ``String`` columns
- the `type` slot now basically follows the SQLAlchemy nomenclature, in particular:
Integer
is now ``integer`` instead of ``int``
BigInteger
is now ``integer``, instead of ``int`` with an arbitrarily different ``width`` than the
one used for Integer
Numeric
is now ``numeric`` instead of ``float``
DateTime
is now ``datetime`` instead of ``date`` with `timestamp` set to ``True``
Time
is now ``time`` instead of ``date`` with `time` set to ``True``
Interval
is now ``interval`` instead of ``string`` with ``timedelta`` set to ``True``
Text
is now ``text`` instead of ``string`` with an arbitrary `width` of ``50``
UnicodeText
is now ``text```
Unicode
is now ``string``
- the `format` slot for DateTime, Date and Time fields is gone, as it was ExtJS specific
__ https://pypi.python.org/pypi/nssjson
4.8 (2017-06-17)
~~~~~~~~~~~~~~~~
* Use a tuple instead of a list for the `foreign_keys` slot in metadata, and for the
`primary_key` too when it is composed by more than one column
4.7 (2017-05-18)
~~~~~~~~~~~~~~~~
* Properly recognize SA Interval() columns
4.6 (2017-05-08)
~~~~~~~~~~~~~~~~
* Handle big integers in metadata information
4.5 (2017-04-10)
~~~~~~~~~~~~~~~~
* Fix a crash when applying a filter on a non-existing column in a statement selecting from a
function
4.4 (2017-04-01)
~~~~~~~~~~~~~~~~
* Rename filter operator ``CONTAINED`` to ``CONTAINS``, and reimplement it to cover different
data types, in particular PostgreSQL's ranges
4.3 (2017-03-22)
~~~~~~~~~~~~~~~~
* Minor tweak, no externally visible changes
4.2 (2017-03-10)
~~~~~~~~~~~~~~~~
* Reduce clutter, generating a simpler representation of Operator and Direction enums
4.1 (2017-02-13)
~~~~~~~~~~~~~~~~
* Fix an oversight in Filter tuple slots positions, to simplify Filter.make() implementation
4.0 (2017-02-13)
~~~~~~~~~~~~~~~~
* From now on, a Python3-only package
* Backward incompatible sorters and filters refactor, to make interaction easier for code using
the library
* Drop obsolete Pylons extension
3.6 (2017-01-11)
~~~~~~~~~~~~~~~~
* New Sphinx documentation
* Field's metadata now carries also information about foreign keys
* Handle literal columns in core queries
3.5 (2016-12-29)
~~~~~~~~~~~~~~~~
* Fix incompatibility issue with SQLAlchemy 1.1.x when using ORM
3.4 (2016-03-12)
~~~~~~~~~~~~~~~~
* Better recognition of boolean argument values, coming from say an HTTP channel as string
literals
* Use tox to run the tests
3.3 (2016-02-23)
~~~~~~~~~~~~~~~~
* Handle the case when the column type cannot be determined
3.2 (2016-02-19)
~~~~~~~~~~~~~~~~
* Fix corner case with queries ordered by a subselect
3.1 (2016-02-07)
~~~~~~~~~~~~~~~~
* Fix metadata extraction of labelled columns on joined tables
* Adjust size of time fields and align them to the right
3.0 (2016-02-03)
~~~~~~~~~~~~~~~~
* Internal, backward incompatible code reorganization, splitting the main module into smaller
pieces
* Handle corner cases with joined queries involving aliased tables
Previous changes are here__.
__ https://bitbucket.org/lele/metapensiero.sqlalchemy.proxy/src/master/OLDERCHANGES.rst
Raw data
{
"_id": null,
"home_page": "https://bitbucket.org/lele/metapensiero.sqlalchemy.proxy",
"name": "metapensiero.sqlalchemy.proxy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Lele Gaifax",
"author_email": "lele@metapensiero.it",
"download_url": "https://files.pythonhosted.org/packages/94/33/f2dd47119f3a7e902133d435281cc150c804aaebc65a3535774633cd460d/metapensiero.sqlalchemy.proxy-5.14.tar.gz",
"platform": "",
"description": ".. -*- coding: utf-8 -*-\n.. :Project: metapensiero.sqlalchemy.proxy\n.. :Created: gio 30 apr 2009 10:01:20 CEST\n.. :Author: Lele Gaifax <lele@metapensiero.it>\n.. :License: GNU General Public License version 3 or later\n.. :Copyright: \u00a9 2009, 2010, 2012, 2013, 2014, 2016, 2017, 2018, 2020 Lele Gaifax\n..\n\n===============================\n metapensiero.sqlalchemy.proxy\n===============================\n\nExpose SQLAlchemy's queries and their metadata to a webservice\n==============================================================\n\n:version: 5\n:author: Lele Gaifax <lele@metapensiero.it>\n:license: GPLv3\n\nThis package contains a few utilities to make it easier applying some filtering to a stock\nquery and obtaining the resultset in various formats.\n\nSee latest documentation at https://metapensierosqlalchemyproxy.readthedocs.io/en/latest/\n\nTests suite\n-----------\n\nThe tests suite is based on ``tox`` and ``pytest``: to run it simply execute\n\n::\n\n $ make check\n\nThe ``PostgreSQL`` unit requires an existing database called ``mp_sa_proxy_test`` with the\n``hstore`` extension, and that the current user can access it without password::\n\n $ createdb mp_sa_proxy_test\n $ psql -c \"create extension hstore;\" mp_sa_proxy_test\n\n\nChanges\n-------\n\n5.14 (2020-04-25)\n~~~~~~~~~~~~~~~~~\n\n* Silently assume ASCending direction in sort criteria\n\n\n5.13 (2020-02-08)\n~~~~~~~~~~~~~~~~~\n\n* Remove deprecated call to pyramid.i18n.get_localizer()\n\n\n5.12 (2018-11-06)\n~~~~~~~~~~~~~~~~~\n\n* Fix deprecated import of abstract classed directly from the collections module\n\n\n5.11 (2018-09-09)\n~~~~~~~~~~~~~~~~~\n\n* Fix deprecation warning related to collections abstract classes import\n\n\n5.10 (2018-07-01)\n~~~~~~~~~~~~~~~~~\n\n* Fix failure extracting metadata of a column associated to a Sequence\n\n\n5.9 (2018-07-01)\n~~~~~~~~~~~~~~~~\n\n* Rename the ``async`` module to ``asyncio`` for Python 3.7 compatibility\n\n\n5.8 (2018-04-13)\n~~~~~~~~~~~~~~~~\n\n* Align the async layer with latest changes related to ``CompoundSelect`` support, now almost\n complete\n\n\n5.7 (2018-04-13)\n~~~~~~~~~~~~~~~~\n\n* Extend last fix to the Pyramid ``expose()`` decorator (yes, I know, I should *really* invest\n some time in writing some tests for that...)\n\n\n5.6 (2018-04-12)\n~~~~~~~~~~~~~~~~\n\n* Handle ``CompoundSelect`` such as ``SELECT 'foo' UNION SELECT 'bar'``\n\n\n5.5 (2018-04-09)\n~~~~~~~~~~~~~~~~\n\n* Fix... last fix :-|\n\n\n5.4 (2018-04-09)\n~~~~~~~~~~~~~~~~\n\n* Fix regression that broke using a generator as an expose() function\n\n\n5.3 (2018-03-15)\n~~~~~~~~~~~~~~~~\n\n* The Pyramid ``expose()`` decorator now forwards unrecognized keyword arguments to the proxy\n call\n\n\n5.2 (2018-03-12)\n~~~~~~~~~~~~~~~~\n\n* Handle extraction of metadata from a ``BinaryExpression`` such as ``SELECT jsonfield['attr']``\n\n\n5.1 (2018-03-08)\n~~~~~~~~~~~~~~~~\n\n* When a column has a *default* value, and it is directly computable (i.e. it is not a server\n side default), then extract it into its metadata\n\n\n5.0 (2017-07-22)\n~~~~~~~~~~~~~~~~\n\n.. warning:: This release **breaks** backward compatibility in several ways!\n\n* More versatile way to add/override basic metadata information (see\n ``register_sa_type_metadata()``)\n\n* More versatile way to use different JSON library or encode/decode settings (see\n ``register_json_decoder_encoder()``): although the default implementation is still based on\n nssjson__, it is *not* required by default anymore at install time\n\n* Basic metadata changed:\n\n - the `width` slot for all fields is gone, it's more reasonably computed by the actual UI\n framework in use: it was rather arbitrary anyway, and set to ``length * 10`` for String\n columns\n\n - the `length` slot is present only for ``String`` columns\n\n - the `type` slot now basically follows the SQLAlchemy nomenclature, in particular:\n\n Integer\n is now ``integer`` instead of ``int``\n\n BigInteger\n is now ``integer``, instead of ``int`` with an arbitrarily different ``width`` than the\n one used for Integer\n\n Numeric\n is now ``numeric`` instead of ``float``\n\n DateTime\n is now ``datetime`` instead of ``date`` with `timestamp` set to ``True``\n\n Time\n is now ``time`` instead of ``date`` with `time` set to ``True``\n\n Interval\n is now ``interval`` instead of ``string`` with ``timedelta`` set to ``True``\n\n Text\n is now ``text`` instead of ``string`` with an arbitrary `width` of ``50``\n\n UnicodeText\n is now ``text```\n\n Unicode\n is now ``string``\n\n - the `format` slot for DateTime, Date and Time fields is gone, as it was ExtJS specific\n\n__ https://pypi.python.org/pypi/nssjson\n\n\n4.8 (2017-06-17)\n~~~~~~~~~~~~~~~~\n\n* Use a tuple instead of a list for the `foreign_keys` slot in metadata, and for the\n `primary_key` too when it is composed by more than one column\n\n\n4.7 (2017-05-18)\n~~~~~~~~~~~~~~~~\n\n* Properly recognize SA Interval() columns\n\n\n4.6 (2017-05-08)\n~~~~~~~~~~~~~~~~\n\n* Handle big integers in metadata information\n\n\n4.5 (2017-04-10)\n~~~~~~~~~~~~~~~~\n\n* Fix a crash when applying a filter on a non-existing column in a statement selecting from a\n function\n\n\n4.4 (2017-04-01)\n~~~~~~~~~~~~~~~~\n\n* Rename filter operator ``CONTAINED`` to ``CONTAINS``, and reimplement it to cover different\n data types, in particular PostgreSQL's ranges\n\n\n4.3 (2017-03-22)\n~~~~~~~~~~~~~~~~\n\n* Minor tweak, no externally visible changes\n\n\n4.2 (2017-03-10)\n~~~~~~~~~~~~~~~~\n\n* Reduce clutter, generating a simpler representation of Operator and Direction enums\n\n\n4.1 (2017-02-13)\n~~~~~~~~~~~~~~~~\n\n* Fix an oversight in Filter tuple slots positions, to simplify Filter.make() implementation\n\n\n4.0 (2017-02-13)\n~~~~~~~~~~~~~~~~\n\n* From now on, a Python3-only package\n\n* Backward incompatible sorters and filters refactor, to make interaction easier for code using\n the library\n\n* Drop obsolete Pylons extension\n\n\n3.6 (2017-01-11)\n~~~~~~~~~~~~~~~~\n\n* New Sphinx documentation\n\n* Field's metadata now carries also information about foreign keys\n\n* Handle literal columns in core queries\n\n\n3.5 (2016-12-29)\n~~~~~~~~~~~~~~~~\n\n* Fix incompatibility issue with SQLAlchemy 1.1.x when using ORM\n\n\n3.4 (2016-03-12)\n~~~~~~~~~~~~~~~~\n\n* Better recognition of boolean argument values, coming from say an HTTP channel as string\n literals\n\n* Use tox to run the tests\n\n\n3.3 (2016-02-23)\n~~~~~~~~~~~~~~~~\n\n* Handle the case when the column type cannot be determined\n\n\n3.2 (2016-02-19)\n~~~~~~~~~~~~~~~~\n\n* Fix corner case with queries ordered by a subselect\n\n\n3.1 (2016-02-07)\n~~~~~~~~~~~~~~~~\n\n* Fix metadata extraction of labelled columns on joined tables\n\n* Adjust size of time fields and align them to the right\n\n\n3.0 (2016-02-03)\n~~~~~~~~~~~~~~~~\n\n* Internal, backward incompatible code reorganization, splitting the main module into smaller\n pieces\n\n* Handle corner cases with joined queries involving aliased tables\n\n\nPrevious changes are here__.\n\n__ https://bitbucket.org/lele/metapensiero.sqlalchemy.proxy/src/master/OLDERCHANGES.rst\n\n\n",
"bugtrack_url": null,
"license": "GPLv3+",
"summary": "Expose SQLAlchemy's queries and their metadata to a webservice",
"version": "5.14",
"project_urls": {
"Homepage": "https://bitbucket.org/lele/metapensiero.sqlalchemy.proxy"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "186a340bb021f29f40ea484115e45e9f742f7ac831ebd33598b14d435460a828",
"md5": "4912c12fe2045a3be67c4708bef7b986",
"sha256": "fb42e173247f3244121161f9798132feb5037efb7b56c0a3add03b2087b31876"
},
"downloads": -1,
"filename": "metapensiero.sqlalchemy.proxy-5.14-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4912c12fe2045a3be67c4708bef7b986",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 32659,
"upload_time": "2020-04-25T08:00:08",
"upload_time_iso_8601": "2020-04-25T08:00:08.975577Z",
"url": "https://files.pythonhosted.org/packages/18/6a/340bb021f29f40ea484115e45e9f742f7ac831ebd33598b14d435460a828/metapensiero.sqlalchemy.proxy-5.14-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9433f2dd47119f3a7e902133d435281cc150c804aaebc65a3535774633cd460d",
"md5": "f4db867c2c2a301f163983491e8bc2a0",
"sha256": "38d6f13370807f786886c6013997c68b2494e2998feff70c2a3d336a7861db26"
},
"downloads": -1,
"filename": "metapensiero.sqlalchemy.proxy-5.14.tar.gz",
"has_sig": false,
"md5_digest": "f4db867c2c2a301f163983491e8bc2a0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 47558,
"upload_time": "2020-04-25T08:00:10",
"upload_time_iso_8601": "2020-04-25T08:00:10.925116Z",
"url": "https://files.pythonhosted.org/packages/94/33/f2dd47119f3a7e902133d435281cc150c804aaebc65a3535774633cd460d/metapensiero.sqlalchemy.proxy-5.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-04-25 08:00:10",
"github": false,
"gitlab": false,
"bitbucket": true,
"codeberg": false,
"bitbucket_user": "lele",
"bitbucket_project": "metapensiero.sqlalchemy.proxy",
"lcname": "metapensiero.sqlalchemy.proxy"
}