[sqlalchemy] Re: VARCHAR(MAX) truncation problems when using SQLAlchemy with long Strings

2017-10-21 Thread Anthony Le
I should add that I am connected to a MSSQL Server 2014 DB. (I know, I know...MS...but...this was not my choice.) -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable

[sqlalchemy] VARCHAR(MAX) truncation problems when using SQLAlchemy with long Strings

2017-10-21 Thread Anthony Le
I have been searching the internet for solutions to the following problem in a nutshell: After I store a long string (of DNA sequences e.g. 6000-12000 characters) in the Database which works, when I use SQLAlchemy to retrieve such sequence, I was initially only getting 255 characters back.

[sqlalchemy] How do I perform a join on a subquery properly in SQLAlchemy?

2014-08-27 Thread Anthony Le
I have a sqlalchemy query using a subquery listed below: test = model.session.query(func.max(SomeEntity.start_time), SomeEntity.name).filter(Run.name.in_(['some name'])).group_by(SomeEntity.name).with_labels().subquery(name = 'sub') SomeEntity.query().join(test,

[sqlalchemy] How do I join a subquery using labels for columns that represent aggregate functions?

2014-08-27 Thread Anthony Le
Sorry for the multiple attempts at posting. I am not sure if posts are time delayed but I am not seeing what I thought I posted. So I am trying one more time. I am trying to convert the following SQL statement into an Sqlalchemy ORM (Version 0.7.4) statement: SELECT

[sqlalchemy] Getting Subquery with labels in SQLAlchemy 0.7.4 to Work

2014-08-27 Thread Anthony Le
I am trying to convert the following SQL statement into an Sqlalchemy ORM (Version 0.7.4) statement: SELECT [hermes_stage].[dbo].[run].[tank] ,[id] ,[experiment_id] ,[local_id] ,[start_time] ,[stop_time] FROM [some_db].[run] INNER JOIN (