This is one of those things that we say you "shouldnt" do. For example it's a non starter in Python 3. So we need to know what the actual problem you need to solve is, as that would determine if/when this bytestring conversion (or perhaps, lack of a Unicode conversion if the issue is performance) takes place.
On Mon, Jan 28, 2019, 6:32 AM <[email protected] wrote: > Hello, > > I'm using sqlalchemy on a PSQL(9.5) DB. When I do a query(below) to the > following table: > > class Molrepo(Base): > > __tablename__ = 'molrepo' > id = Column(Text, primary_key=True) > molrepo_name = Column(Text, index=True) > src_id = Column(Text) > smiles = Column(Text) > inchikey = Column(Text, index=True) > inchi = Column(Text) > > QUERY: > > query.with_entities(Molrepo.molrepo_name, Molrepo.src_id, Molrepo.smiles, > Molrepo.inchikey, Molrepo.inchi).all() > > The returned values are of type *unicode*. I would like that by default > the return values to be of type *str*. How can I do that? The DB client > encoding is already set to 'UTF-8'. > Thanks, > > oriol > > -- > 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 Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > -- 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 Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
