[sqlalchemy] sequence in sqlalchemy

2020-07-02 Thread Anoop Thiparala
id = db.Column(db.Integer, Sequence('patients_seq', start=1, increment=1) , primary_key=True) any reason why this is not working with sqlite3 -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE:

[sqlalchemy] convert subset to dictionary

2020-07-02 Thread Justvuur
Hi there, I'm struggling to find an efficient way to get a two columned subset into dictionary form. I have an entity that has a subset of data. The subset is linked to the entity via Id. The order of the subset of data is defined in another table. Example: Student - Id, firstname, lastname

Re: [sqlalchemy] Hoarded RAM

2020-07-02 Thread Mike Bayer
On Thu, Jul 2, 2020, at 12:21 PM, Massimiliano della Rovere wrote: > Greetings, > I am using > * SQLAlchemy: 1.3.3 > * psycopg2-binary: 2.8.3 > * postgresql: 9.6 > > While running a SQLAlchemy CORE script that makes lots of updates (about > 300k), some inserts (about 50k) and commits data only

Re: [sqlalchemy] inspection does not update mapper schema when schema assigned to declarative during runtime

2020-07-02 Thread Mike Bayer
On Thu, Jul 2, 2020, at 12:23 PM, Peter Lai wrote: > It appears that if during runtime I assign a schema to declarative, then > `inspect()` it, the resulting Selectable does not have the schema assigned to > it: > > in model.py: > > from sqlalchemy import Column, String, DateTime > from

[sqlalchemy] inspection does not update mapper schema when schema assigned to declarative during runtime

2020-07-02 Thread Peter Lai
It appears that if during runtime I assign a schema to declarative, then `inspect()` it, the resulting Selectable does not have the schema assigned to it: in model.py: from sqlalchemy import Column, String, DateTime from sqlalchemy.ext.declarative import declarative_base Base =

[sqlalchemy] Hoarded RAM

2020-07-02 Thread Massimiliano della Rovere
Greetings, I am using * SQLAlchemy: 1.3.3 * psycopg2-binary: 2.8.3 * postgresql: 9.6 While running a SQLAlchemy CORE script that makes lots of updates (about 300k), some inserts (about 50k) and commits data only at the end, the script consumes about 8GB+ RAM (well... we have to stop it to avoid

Re: [sqlalchemy] Getting SQLite INTEGER PRIMARY KEY for a column

2020-07-02 Thread Richard Damon
On 7/1/20 10:12 PM, Mike Bayer wrote: > > I think you might be reading that phrase (not sure where you read it) > too literally.  per https://www.sqlite.org/lang_createtable.html#rowid > > > With one exception noted below, if a rowid table has a primary key > that consists of a single column and

Re: [sqlalchemy] SQL injection

2020-07-02 Thread Simon King
I don't understand. SQLAlchemy will not help you "generate SQL injections". It's just a library for talking to databases. Applications that *use* SQLAlchemy might be vulnerable to SQL injections if they are careless, but if you use it in the recommended way, SQL statements are parameterized and