.
This is simply done by override the standard operators of Python in the
Expression class (which derive all SQL expressions)
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are su
a risk
that the attribute name collide with an attribute of the class.
So the best option is to instantiate columns:
columns = [Column(table1, f) for f in ["field1", "field2"]]
query = table1.select(columns)
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck
; WHERE 1 = 1
>
> Is this something that's possible?
Yes, you must use explicit Literal:
select.where = Literal(1) == Literal(1)
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message
.execute(*select)
The query object is iterable and return the query string follwed by the
params.
Or if you prefer you can also run:
cursor.execute(str(select), select.params)
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.co
Aggregate
class ArrayAgg(Aggregate):
__slots__ = ()
_sql = 'ARRAY_AGG'
ARRAY_TO_JSON is even less in the standard as JSON type is not in the
standard. But it can also easily implemented:
from sql.functions import Function
class ArrayToJson(Function):
On 2017-09-07 17:08, Richard PALO wrote:
> Do I understand therefore that aliasing is indeed not supported on tables
> (that is, only on columns)?
alias on table is pointless in python-sql because query is written using
Python variable which has the same purpose.
--
Cédric Krier - B2C
question about optimizing the __and__ operator to
append to the first And instead of encapsulate. I think it is an
optimization that will increase code complexity for a very small gain (2
chars).
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://
code, jnl.name, jnl.type, jnl.sequence_name,
> > jnl.default_debit_account, jnl.default_credit_account)
> >
> >
>
> The print statement pretty much shows the query I intended though what I don't
> get now is why python-sql needs the 'distinct_on' cla
://pypi.python.org/pypi/python-sql/0.9
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups
"python-sql" group.
To unsubscribe from this group and stop receiv
op-post on this mailing list, see
http://groups.tryton.org/netiquette
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups
"python-sql" group.
T
On 2016-09-14 10:35, Cédric Krier wrote:
> On 2016-09-14 00:10, Ruben Nielsen wrote:
> > Any plans on adding SELECT DISTINCT? I see in the code, that there is a
> > TODO comment in place.
>
> Usually DISTINCT can be avoided by using a GROUP BY.
> But it should not be to
is was not planned to support Select replacement.
Indeed what do you try to add?
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups
"python-sql&quo
12 matches
Mail list logo