Re: [sqlalchemy] MySQL Connector

2019-03-05 Thread Warwick Prince
Hi Mike

Thanks very much.  It’s a shame they broke it so badly!  I’ll change to your 
recommendation immediately.

Cheers
Warwick 

Warwick A. Prince
Mushroom Systems International Pty. Ltd.

> On 5 Mar 2019, at 3:07 am, Mike Bayer  wrote:
> 
>> On Sun, Mar 3, 2019 at 8:40 PM Warwick Prince  
>> wrote:
>> 
>> Hi Community
>> 
>> We’ve been using sqlalchemy with great success for many years.  We’ve been 
>> using the mysqlconnector to connect to my MySQL databases with no issues to 
>> speak of.
>> 
>> My issue is that I recently upgraded to the latest version of the connector 
>> from Oracle which has changed from Python to C.  I’m now regularly receiving 
>> the following error where this has never happened in the past;   MySQL 5.6 
>> BTW.
>> 
>> DatabaseError: (mysql.connector.errors.HashError) Hashed authentication data 
>> is invalid
>> 
>> Obviously, I would assume that this is not a sqlalchemy issue, however 
>> there’s nothing really being spoken about this anywhere else and I wondered 
>> if anyone had had the problem and fixed it - or eventually rolled back to 
>> the very old version of mysqlconnector?
> 
> Unfortunately recent versions of MySQL connector, specifically when
> the C code was added, work very poorly, such that I had to remove
> mysql connector from testing.   I documented a partial list of
> blocking issues I encountered here:
> https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#current-issues
> 
> 
>> 
>> Alternatively, @Mike - could you recommend in your opinion the ‘best’ 
>> connector to use for MySQL based on reliability and performance.
> 
> The best drivers for MySQL are mysqlclient and pymysql, both
> maintained by the same person.  Both drivers work very well and are
> well supported.   mysqlclient is a fork of the original C based
> python-mysql driver which is no longer maintained.
> 
> 
>> 
>> Cheers
>> Warwick
>> 
>> Warwick Prince
>> Managing Director
>> mobile: +61 411 026 992
>> skype: warwickprince
>> phone: +61 7 3102 3730
>> fax:  +61 7 3319 6734
>> web: www.mushroomsys.com
>> 
>> --
>> 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 sqlalchemy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> 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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] User name and password on local database

2019-03-05 Thread Rich Shepard

On Tue, 5 Mar 2019, Mike Bayer wrote:


sure, if your PG database allows you to connect using "trust" or other
localhost-style connection you can omit everything from the URL


Thanks, Mike.

Yes, I have all hosts on the LAN set to trust as nothing is exposed to the
world.

Best regards,

Rich

--
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] User name and password on local database

2019-03-05 Thread Mike Bayer
sure, if your PG database allows you to connect using "trust" or other
localhost-style connection you can omit everything from the URL

create_engine("postgresql://localhost/dbname")

or

create_engine("postgresql://user@localhost/dbname")

create_engine("postgresql:///dbname")

etc

On Tue, Mar 5, 2019 at 2:31 PM Rich Shepard  wrote:
>
> I'm writing an application for my business use; I'll be the only user and
> postgres is on the same server/workstation host. When I specify the engine
> using create_engine() can I leave off at least my password if not both it
> and my username? The database to which SA is connecting is owned by me.
>
> TIA,
>
> Rich
>
> --
> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> 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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] User name and password on local database

2019-03-05 Thread Rich Shepard

I'm writing an application for my business use; I'll be the only user and
postgres is on the same server/workstation host. When I specify the engine
using create_engine() can I leave off at least my password if not both it
and my username? The database to which SA is connecting is owned by me.

TIA,

Rich

--
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Redefine class on runtime

2019-03-05 Thread Mike Bayer
Also there's a long term plan to remove classical mappings as a first
class feature, replacing it with an equivalent function that applies
declarative mapping to a class.There isn't a plan to have a
"clear_mappers()" in this case, the way you clear a mapping for a
class is that you stop using that class and allow it to be garbage
collected.   If your class happens to be referred to by a superclass
which sees it as one of the inheriting mappers it might have to load,
there's no plan to support surgical removal of that subclass.So
you'd want to stop using the superclass as well.

This all points to the recommended way to do this, which is to just
use declarative normally and if you need a different kind of class  /
table def inside of a polymorphic inheritance hierarchy for the same
name, you build out a new polymorphic inheritance hierarchy and throw
the old one away.  mapper.dispose() is not going to alter the
polymorphic collection of the superclass either.

Supporting the surgical removal of specific mappers from an existing
mapper hierarchy adds a huge amount of complexity, testing, and
development effort to every new mapping feature that associates
mappers together, which is why we don't support this use case.




On Tue, Mar 5, 2019 at 8:54 AM Mike Bayer  wrote:
>
> The individual mapper clear process is via the mapper.dispose()
> method.   The individual class that was mapped will be de-instrumented
> and act like a regular Python class.
>
> The next steps to take depend very highly on what kind of mappings you
> are using and what you are trying to do.
>
>
> On Tue, Mar 5, 2019 at 2:00 AM Tolstov Sergey  wrote:
> >
> > Thanks for answer,  can i get only part of classes mappers? Somethink about 
> > Myclass.mapper.clear()?
> >
> > --
> > 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 sqlalchemy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sqlalchemy@googlegroups.com.
> > 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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Redefine class on runtime

2019-03-05 Thread Mike Bayer
The individual mapper clear process is via the mapper.dispose()
method.   The individual class that was mapped will be de-instrumented
and act like a regular Python class.

The next steps to take depend very highly on what kind of mappings you
are using and what you are trying to do.


On Tue, Mar 5, 2019 at 2:00 AM Tolstov Sergey  wrote:
>
> Thanks for answer,  can i get only part of classes mappers? Somethink about 
> Myclass.mapper.clear()?
>
> --
> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> 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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.