Re: [sqlalchemy] Possible error with fully qualified table names

2020-12-22 Thread Benjamin Taub
Perfect! Thank you, Mike. Ben __ [image: Dataspace] Benjamin Taub, CEO Direct: (734) 585-3503 Check out Golden Record , our cloud-based record matching and deduplication solution Blog:

Re: [sqlalchemy] Possible error with fully qualified table names

2020-12-22 Thread Mike Bayer
you could use "fullname" but you would need to apply string splitting across the dot and then quoting of the individual tokens. assuming you are using case insensitive identifiers it would be safe to generically do the above for all strings if you wanted: qualified_name = ".".join( "`%s`" %

Re: [sqlalchemy] Possible error with fully qualified table names

2020-12-22 Thread Benjamin Taub
Thank you, Mike. In my case, I am writing a TRUNCATE TABLE statement. I don't think SQLAlchemy provides that so I'm writing it in text and having the engine execute it rather than having SQLAlchemy generate it. Are you recommending, therefore, that I not use the *fullname* attribute for this?

Re: [sqlalchemy] Possible error with fully qualified table names

2020-12-22 Thread Mike Bayer
the .fullname attribute is not used directly in SQL statements, when a schema or table name requires quoting the compiler will apply them as needed. from sqlalchemy import Column from sqlalchemy import String from sqlalchemy.dialects import mysql from sqlalchemy.ext.declarative import

[sqlalchemy] Possible error with fully qualified table names

2020-12-22 Thread Benjamin Taub
schema.py defines a variable fullname for tables as follows: if self.schema is not None: self.fullname = "%s.%s" % (self.schema, self.name) else: self.fullname = self.name However, this fails for me in some cases, apparently when my table or schema name starts with a number. To address