Re: [sqlalchemy] MySQL default driver for python3

2019-03-14 Thread 'Van Klaveren, Brian N.' via sqlalchemy
Hi Tomek, You actually want mysqlclient, which is the maintained fork of mysqldb: https://pypi.org/project/mysqlclient/ Brian On Mar 14, 2019, at 7:41 AM, Tomek Rożen mailto:tomek.ro...@gmail.com>> wrote: Hi, 'mysqldb' is the default driver, however it does not support python3. Any chance

Re: [sqlalchemy] Re: Security Implications of Directly Executing Queries Compiled to Strings

2019-03-08 Thread 'Van Klaveren, Brian N.' via sqlalchemy
As has been said, if you are generating the SQL, you will be fine so long as you use parameters and no blind string interpolation. This isn't really any different that any other API in that regard - obviously you don't want to allow a non-substituted first name field of the form `'; DROP TABLE

[sqlalchemy] Proper way to handle new 128 character identifier limit in Oracle >= 12.2

2018-11-08 Thread 'Van Klaveren, Brian N.' via sqlalchemy
Hi, Oracle 12.2 now allows 128 character length identifiers: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/newft/new-features.html#GUID-64283AD6-0939-47B0-856E-5E9255D7246B It'd be great if sqlalchemy knew about this, but what's the proper way of handling this? Just use the

[sqlalchemy] Custom type compilers interplace with with_variant

2018-11-06 Thread 'Van Klaveren, Brian N.' via sqlalchemy
Hi, I want to create a custom type for TINYINT and DOUBLE. I've defined them as custom types. I want to use with_variant for them, so that in sqlite they print out as TINYINT and DOUBLE. But I also want them to use the variants defined for other databases, like Oracle and Postgres. The

[sqlalchemy] Is FLOAT(53) the best way to guarantee a double-precision generic column type

2018-05-02 Thread Van Klaveren, Brian N.
I'm trying to work on a universal table generator based on in-memory table objects. The code is based on the work from the pandas to_sql. I'll be targeting Oracle, Postgres, MySQL, and SQLite for sure. It seems like making sure to use Float(53) is the best way to guarantee that a column will

[sqlalchemy] Adding a relationship for specific rows based on foreign value

2017-06-19 Thread Van Klaveren, Brian N.
Hi, I want to represent a One to Many relationship with an additional default value that depends on a value in the foreign table. I think what I want is something like the following: class UserDatabase(Base): db_id = Column(Integer, primary_key=True) repo_id = Column(Integer,

[sqlalchemy] Additional error handling using MySQLdb.connection extended API

2017-05-18 Thread Van Klaveren, Brian N.
Hi, I need access to MySQLdb.connection.error() and MySQLdb.connection.errno(), as we have a database which is throwing custom error codes that are higher than CR_MAX_ERROR (for reference: https://github.com/PyMySQL/mysqlclient-python/blob/master/_mysql.c#L124) My actual code looks like

[sqlalchemy] get_schema_names doesn't work with SQLite attached databases

2015-09-09 Thread Van Klaveren, Brian N.
Hi, I'm trying to find the attached databases of a SQLite database. I was expecting Inspector.get_schema_names to return something like: $ sqlite3 foo.db sqlite> create table a (a_id integer); sqlite3 bar.db sqlite> create table b (b_id integer); from sqlalchemy import create_engine from

[sqlalchemy] Retrieving a row/cursor's description object from a ResultSetProxy

2015-08-10 Thread Van Klaveren, Brian N.
Hi, I want to get extra type information from a given column after performing a query like the following: results = engine.execute(text(SELECT a, b FROM Attributes)) It seems the only way to really do this is to use cursor from results.cursor.description. Is this the preferred method, or is

Re: [sqlalchemy] The use of SQLAlchemy for a long term project

2015-04-20 Thread Van Klaveren, Brian N.
, Brian On Apr 18, 2015, at 2:47 PM, Mike Bayer mike...@zzzcomputing.commailto:mike...@zzzcomputing.com wrote: On 4/17/15 6:58 PM, Van Klaveren, Brian N. wrote: Hi, I'm investigating the use and dependency on SQLAlchemy for a long-term astronomy project. Given Version 1.0 just came out, I've

[sqlalchemy] The use of SQLAlchemy for a long term project

2015-04-17 Thread Van Klaveren, Brian N.
Hi, I'm investigating the use and dependency on SQLAlchemy for a long-term astronomy project. Given Version 1.0 just came out, I've got a few questions about it. 1. It seems SQLAlchemy generally EOLs versions after about two releases/years. Is this an official policy? Is this to continue with