[sqlalchemy] chinook with sqlalchemy core

2023-04-12 Thread sumau
Hello Is there a sqlalchemy core version of the chinook database https://github.com/lerocha/chinook-database? A python script which creates the different tables and populates them with the same data? Regards Soumaya -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://

Re: [sqlalchemy] missing schema authorization clause

2023-04-07 Thread sumau
reating-schema, > > where you are probably looking for: > > with engine.begin() as conn: > conn.execute(text("create user {schema_name} identified by > {password}")) > > > > On Wed, Apr 5, 2023, at 6:26 PM, sumau wrote: > > Hello > > Is it

[sqlalchemy] missing schema authorization clause

2023-04-05 Thread sumau
Hello Is it possible to pass in the authorization when creating a schema with the oracle dialect? oracle_engine = create_engine( f"oracle://{user}:{password}@{host}:{port}/{database_name}" ) inspector = inspect(oracle_engine) if schema_name not in inspector.get_schema_names(): oracle_engine.exec

[sqlalchemy] Re: IDLE vs checked in connection

2021-05-08 Thread sumau
Hello Our postgreSQL database is suffering from too many IDLE connections and I'm wondering if this has to do with isolation level which we usually set to AUTOCOMMIT. When I use the default connection settings then checked-in connections do not appear as IDLE in postgres: engine = create_engi

[sqlalchemy] IDLE vs checked in connection

2021-05-08 Thread sumau
Hello Our postgreSQL database is suffering from too many IDLE connections and I'm wondering if this has to do with isolation level which we usually set to AUTOCOMMIT. When I use the default connection settings then checked-in connections do not appear as IDLE in postgres: engine = create_engi

[sqlalchemy] compiler tutorial questions

2021-04-19 Thread sumau
Hello I'm trying to understand compilation and working through the compiler tutorial: https://docs.sqlalchemy.org/en/14/core/compiler.html I was hoping for some clarification : 1) What is the difference between starting your method with visit_XXX instead of compile_XX? 2) self.cmd is used in

[sqlalchemy] autocommit Transaction Isolation Level

2021-04-01 Thread sumau
Hello Following advice from this article: https://www.oddbird.net/2014/06/14/sqlalchemy-postgres-autocommit/ and because we run large, consecutive queries, we set our transaction isolation level to 'autocommit' when connecting to our postgres DB. This means we cannot create explicit transaction

Re: [sqlalchemy] Custom Compilation

2020-03-19 Thread sumau
Thanks Mike that worked perfectly :-) -- 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. --- Y

Re: [sqlalchemy] sort table by primary keys

2020-01-06 Thread sumau
Head-smack! Thanks and happy new year Soumaya On Monday, 6 January 2020 02:20:01 UTC, Mike Bayer wrote: > > did you try: > > order_by(*t.primary_key) > > ? > > > > On Sun, Jan 5, 2020, at 7:02 PM, sumau wrote: > > Hello > > I was wondering if it was po

[sqlalchemy] sort table by primary keys

2020-01-05 Thread sumau
Hello I was wondering if it was possible to sort a table by its 'unspecified' primary keys using the SQL Alchemy Expression Language? I have tried the following: t = Table ('test',metadata,autoload=True) select([t]).order_by(t.primary_key.columns) but I get the following error: sqlalchemy.

[sqlalchemy] Re: Assert ResultProxy

2019-12-02 Thread sumau
(a=seq1, b=seq2, autojunk=False) > print(sm.get_opcodes()) > print(f'similarity: {sm.ratio()}') > > assert sm.ratio() == 1 # example to ensure results are equivalent > assert sm.ratio() == 1, sm.get_opcodes() # pytest syntax to show the > opcodes if the assertion fails > >

[sqlalchemy] Re: Assert ResultProxy

2019-11-29 Thread sumau
own script :-) Regards S On Friday, 22 November 2019 10:50:54 UTC, sumau wrote: > > Hello > > I would like to assert the contents of tables in my PG schema i.e. make > sure it contains the data I'm expecting > > I am aware of various options: > > 1) Compare the ac

[sqlalchemy] Assert contents of DB tables

2019-11-22 Thread sumau
Hello I would like to assert the contents of tables in my PG schema i.e. make sure it contains the data I'm expecting I am aware of various options: 1) Compare the actual and expected tables using a sql query, orchestrated by sqlalchemy (i.e. create the actual and expected tables in DB, run th

Re: [sqlalchemy] TableProxy equivalent to RowProxies

2019-10-28 Thread sumau
Crystal clear thanks! -- 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

[sqlalchemy] TableProxy equivalent to RowProxies

2019-10-27 Thread sumau
RowProxy have useful functionality like row.keys() and row['column'] If I use fetchmany/fetchall I return a list of RowProxies. Is the best way of keeping the functionality of RowProxies to convert the list to a pandas data frame? Are there any plans to create "Table"Proxy equivalent to RowProxy