On Fri, Oct 16, 2020, at 10:25 AM, Simon King wrote:
> Yep, I misunderstood what setinputsizes was doing. I thought it told
> pyodbc how it should handle a particular datatype,
that would be great if it worked that way :) however alas...
>
>
> rather than telling
> it how to handle the
Yep, I misunderstood what setinputsizes was doing. I thought it told
pyodbc how it should handle a particular datatype, rather than telling
it how to handle the set of parameters it is about receive in the next
execute() call...
Sorry for adding to the confusion,
Simon
On Fri, Oct 16, 2020 at
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import update
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class A(Base):
On Fri, Oct 16, 2020, at 2:30 AM, Kotofos online wrote:
> I'm working on raw SQL feature, and it has to support distinct and sort.
> Instead of parsing and modifying user query, I'm wrapping it as subquery and
> then do distinct and sort.
>
> ```
> user_query = 'select "FirstName", from
On Fri, Oct 16, 2020, at 3:53 AM, Nicolas Lykke Iversen wrote:
> Is it really necessary to use your very-subtle vendored version of the
> set_input_sizes() hook? Why use it compared to Simon King's simple version?
yes, because cursor.setinputsizes() must be passed an entry for every bound
Greetings,
how should I write the .values() section of a CORE update() statement to
render the following
postgres syntax?
The data column is a JSON(B) and contains a dict object.
UPDATE settings
SET data = data || '{"key": "value"}'
WHERE key = 'my_param';
Thanks,
Massimiliano
--
SQLAlchemy -
Thank you, Mike.
pyODBC has the following to say about the issue:
*SQLAlchemy. pyODBC is generic and does not know about special handling of
varchar(max), whereas SQLAlchemy appears to have code for specific database
types. It needs to call setinputsizes as you described, when the length is
I'm working on raw SQL feature, and it has to support distinct and sort.
Instead of parsing and modifying user query, I'm wrapping it as subquery
and then do distinct and sort.
```
user_query = 'select "FirstName", from "Customer"'
stmt = text(user_query)
stmt =