[sqlalchemy] Re: Where is the exactly .db file if I use sqlite code in the example

2022-12-06 Thread Ryan Lee
thank you I understand 2022년 12월 7일 수요일 오전 2시 56분 57초 UTC+9에 leleg...@gmail.com님이 작성: > Ryan Lee writes: > > > https://docs.sqlalchemy.org/en/14/orm/quickstart.html#create-an-engine > > > > ``` > > engine = create_engine("sqlite://", echo=True, fu

[sqlalchemy] Where is the exactly .db file if I use sqlite code in the example

2022-12-06 Thread Ryan Lee
https://docs.sqlalchemy.org/en/14/orm/quickstart.html#create-an-engine ``` engine = create_engine("sqlite://", echo=True, future=True) ``` If I use the code in example , I cannot find the exact file , where is it ? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

[sqlalchemy] how can I select schema while using sqlacodegen crawling postgresql db models

2022-10-11 Thread Ryan Lee
when I prepare crawling db dto from postgresql( AWS RDS) for my flask application, I set SQLAlchemy URI like follow f'{RDS_PROTOCOL}://{RDS_USERNAME}:{RDS_PASSWORD}@{RDS_HOSTNAME}:{RDS_PORT}/{RDS_DB_NAME}' but I don't know how to define one specific schema pls let me knowTT -- SQLAlchemy

[sqlalchemy] Re: Connection error

2021-06-16 Thread Ryan Bandler
Anyways guys I was able to fix the issue by installing a flask-specific version of the same package (even though I am not using flask) and I was able to get it to work just fine. Thanks everyone for your help. On Wednesday, June 16, 2021 at 9:20:37 AM UTC-4 Ryan Bandler wrote: > Yeah I conn

[sqlalchemy] Re: Connection error

2021-06-16 Thread Ryan Bandler
could not connect to server: Connection refused > Is the server running on host "127.0.0.1" and accepting > > TCP/IP connections on port 5432? > > On Tuesday, June 15, 2021 at 1:06:23 PM UTC-4 Ryan Bandler wrote: > >> Hello everyone, >> >> I am a fi

Re: [sqlalchemy] Connection error

2021-06-15 Thread Ryan Bandler
this tool because I have many tables with lots of columns and I dont like typing boilerplate code when I dont have to. My question was not about SA itself or how writing the model works ,but about this error I am experiencing with this generator tool. I appreciate the response though! Best, Ryan

[sqlalchemy] Connection error

2021-06-15 Thread Ryan Bandler
Hello everyone, I am a first-time SQLalchemy user planning on using SQLalchemy on a new project. We already have an established postgres database (currently still on localhost) which I do not want to handwrite the SQLalchemy model for. So I am planning to use sqlacodegen. Unfortunately,

Re: [sqlalchemy] Aldjemy many to many modeling

2021-05-19 Thread Ryan Hiebert
And nope. It's coming when I'm running `aliased`, but it doesn't seem to be directly related, even though it's the same warning. I think it has to do with how I'm translating inherited models. Sorry for the false alarm. On Wednesday, May 19, 2021 at 8:50:56 PM UTC-5 Ryan Hiebert wrote: > S

Re: [sqlalchemy] Aldjemy many to many modeling

2021-05-19 Thread Ryan Hiebert
So I am able to just add it on the many-to-many relationship, that worked just fine. Unfortunately, I'm now having a similar issue come up when I use `aliased` on a generated model. Do you have any suggestion for how to handle that? It strikes me that either (a) aliased doesn't expect to be

Re: [sqlalchemy] Aldjemy many to many modeling

2021-05-19 Thread Ryan Hiebert
, to adjust existing relationships with this after they are created. Does that sound right? Thanks for all your help, and for the excellent docs on these warnings. While I still have questions, I was able to understand quite a lot of it before I needed to come ask for assistance. Ryan -- SQLAlch

[sqlalchemy] Aldjemy many to many modeling

2021-05-19 Thread Ryan Hiebert
change, so I'd like to choose the wisest option, that most cleanly fits into the patterns that SQLAlchemy users will most readily understand. Thank you, Ryan -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please prov

Re: [sqlalchemy] FetchedValue() updated by UPDATE to a different table

2020-06-19 Thread Ryan Kelly
) to go through the > list of parent objects that have changed, traverse through the child > objects you care about and call session.expire() on the attributes in > question. > > On Thu, Jun 18, 2020, at 7:47 PM, Ryan Kelly wrote: > > Hi, > > We have some functional

[sqlalchemy] FetchedValue() updated by UPDATE to a different table

2020-06-18 Thread Ryan Kelly
wondering what approach I might take here to get these linked tables to expire in a manner that is centralized and doesn't require users to explicitly require certain objects (or all objects). -Ryan -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org

Re: [sqlalchemy] AWS RDS generate-db-auth-token and Redshift get-cluster-credentials

2020-05-23 Thread Ryan Kelly
; > > You can modify how the engine makes connections using the do_connect event > hook: > > > https://docs.sqlalchemy.org/en/13/core/events.html?highlight=do_connect#sqlalchemy.events.DialectEvents.do_connect > > each time the engine/ pool go to make a new connection, you can af

[sqlalchemy] AWS RDS generate-db-auth-token and Redshift get-cluster-credentials

2020-05-22 Thread Ryan Kelly
, solution. What I am asking, I suppose, is 1) am I missing something obvious that would make this achievable? and 2) if not, what kind of best-approach pull request could I produce that could make this happen? Thanks, -Ryan -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http

[sqlalchemy] How to speed up Pandas read_sql (with SQL Alchemy as underlying engine) from Oracle DB?

2019-12-02 Thread Ryan Wolniak
I'd like to optimize querying and converting a list of Oracle tables into pandas dataframes. The eventual goal is to convert to Parquet, write to disk, then upload to S3, but for now I just want to focus on the pandas / sqlalchemy / parallelism part. My code sort of works, but it's very

[sqlalchemy] server_default=text('1970-01-01 00:00:01') changed when run in a different timezone

2019-10-09 Thread Thomas Ryan
I have the following fields defined in a table. `updated` datetime NOT NULL DEFAULT '1970-01-01 00:00:01', `deleted` datetime NOT NULL DEFAULT '1970-01-01 00:00:01', When someone runs SQLACODEGEN it changes the definition of the server_default time based on the timezone the developer is in

Re: [sqlalchemy] SQLlite: enforce a unique constraint on a relation?

2018-03-12 Thread Ryan Holmes
Thanks Mike, While I would rather this be a hard constraint on the database, not enforced in python, I understand that SQLite is pretty limited in this regard, so I'm down to try anything really. I also had the idea of using a custom collection simply because the project already uses them

[sqlalchemy] SQLlite: enforce a unique constraint on a relation?

2018-03-11 Thread Ryan Holmes
(cross posted from https://stackoverflow.com/questions/49225846/) Lets say I have 3 tables: parent, child, and a linker table for the two for a many-to-many relationship, `parentChildren`. Each parent can have multiple children, and each child can have multiple parents. If parent 1 already has

Re: [sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
20, 2017 at 10:20:51 AM UTC-7, Mike Bayer wrote: > > > > On 06/20/2017 01:04 PM, Ryan Weinstein wrote: > > > > > > On Tuesday, June 20, 2017 at 9:53:10 AM UTC-7, Jonathan Vanasco wrote: > > > > you're almost there. > > > > flip

[sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
On Tuesday, June 20, 2017 at 9:53:10 AM UTC-7, Jonathan Vanasco wrote: > > you're almost there. > > flip a few lines around to rewrite the query to select from product... > e.g. something like > > SELECT r_product_list.* FROM r_product_list > JOIN r_product_category_history_list on >

[sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
On Tuesday, June 20, 2017 at 9:53:10 AM UTC-7, Jonathan Vanasco wrote: > > you're almost there. > > flip a few lines around to rewrite the query to select from product... > e.g. something like > > SELECT r_product_list.* FROM r_product_list > JOIN r_product_category_history_list on >

[sqlalchemy] Re: Only return single entity from query

2017-06-20 Thread Ryan Weinstein
On Monday, June 19, 2017 at 6:40:04 PM UTC-7, Jonathan Vanasco wrote: > > You're not joining anything onto the `rProductCategoryHistory` table, so > depending on your DB you may be getting populated rows for rProduct that > don't match anything. > > you probably want something like this... > >

[sqlalchemy] Only return single entity from query

2017-06-19 Thread Ryan Weinstein
query = db.session.query(rProductCategoryHistory,rProduct)\ .join(rProduct,rProduct.r_id==rProductCategoryHistory.r_id)\ .join(rProductHistoricalDetails, rProductHistoricalDetails.id==rProduct.most_recent_historical_details_id)\

[sqlalchemy] Feedback on "Basic Relationship Patterns" docs

2016-04-11 Thread Ryan Govostes
bvious. The descriptions of the current examples all immediately jump into technical details of foreign keys, scalars, and association tables. Ryan -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop rec

[sqlalchemy] Filter by first in relationship

2015-09-02 Thread Ryan Eberhardt
Hello, I have User and Session classes like this: class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) sessions = relationship('Session') @property def last_login_time(self): return sorted(self.sessions, reverse=True, key=lambda x:

Re: [sqlalchemy] Accessing association-specific data from a self-referential many-to-many relationship using association_proxy?

2015-07-06 Thread Ryan Holmes
complicates things, since most resources I find have two distinct objects along with the association. On Monday, July 6, 2015 at 1:14:29 PM UTC-4, Michael Bayer wrote: On 7/6/15 12:06 PM, Ryan Holmes wrote: I have an interesting problem that I haven't been able to solve for quite

[sqlalchemy] Accessing association-specific data from a self-referential many-to-many relationship using association_proxy?

2015-07-06 Thread Ryan Holmes
I have an interesting problem that I haven't been able to solve for quite some time. I keep finding information about association proxies and the like, but nothing that really helps (or maybe I'm implementing it incorrectly). Let's start with this: class HandledProjectedItemList(list):

[sqlalchemy] Preventing duplicate entries for an association proxy

2015-05-22 Thread Lie Ryan
I am currently stuck on creating association proxy. The composite association_proxy ( http://docs.sqlalchemy.org/en/latest/orm/extensions/associationproxy.html#composite-association-proxies) pattern pointed to using UniqueObject recipe (

Re: [sqlalchemy] Difference between this SQL query and this sqlalchemy one?

2014-08-02 Thread Ryan Kelly
. Thanks, Elliot -Ryan -- 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

Re: [sqlalchemy] Re: FAQ for CREATE TABLE output incomplete

2014-06-18 Thread Ryan Kelly
issuing DDL using information from untrusted sources, but it probably should. -Ryan Kelly -- 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

[sqlalchemy] FAQ for CREATE TABLE output incomplete

2014-06-17 Thread Ryan Kelly
of the given solution, at a minimum. -Ryan Kelly -- 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

Re: [sqlalchemy] Adding where clause to existing SELECT without wrapping SELECT

2014-05-19 Thread Ryan Kelly
Is there some issue with doing: sel2 = sel.where(product_table.c.name == water) ? If you really have no reference to the product_table, I think you can hack it with sel._raw_columns to try and find the column you want to filter to. -Ryan Kelly On Mon, May 19, 2014 at 9:12 PM, gbr doubl

Re: [sqlalchemy] Argument to LIMIT must be a number?

2014-03-21 Thread Ryan Kelly
I see your compatibility concerns. Let me see if .offset() without .limit() does the right thing. -Ryan Kelly On Thu, Mar 20, 2014 at 10:39 PM, Michael Bayer mike...@zzzcomputing.com wrote: the int() catch here on limit/offset is something we added due to user report which raised the issue

[sqlalchemy] Argument to LIMIT must be a number?

2014-03-20 Thread Ryan Kelly
way to convince SQLAlchemy to render these values? -Ryan Kelly -- 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

Re: [sqlalchemy] Argument to LIMIT must be a number?

2014-03-20 Thread Ryan Kelly
Redshift needs LIMIT ALL to avoid attempting an optimization which causes it to crash. Note that OFFSET 0 is the same as omitting OFFSET, but it acts as an optimization fence. This, I suppose, is a similar thing. -Ryan Kelly On Thu, Mar 20, 2014 at 5:38 PM, Michael Bayer mike

[sqlalchemy] outerjoin where first selected column is a literal dies with confusing error

2014-03-17 Thread Ryan Kelly
that way, but the error message cost me about 30 minutes just trying to figure out why. Not sure if there is a good way to fix this or what the correct approach is. -Ryan Kelly -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from

Re: [sqlalchemy] TypeError: Range objects cannot be ordered in flush

2013-12-24 Thread Ryan Kelly
be patched, since they basically just didn't implement ordering. PostgreSQL itself has no problem ordering range types (though the ordering is somewhat arbitrary): http://www.postgresql.org/docs/9.2/static/rangetypes.html#RANGETYPES-GIST -Ryan signature.asc Description: Digital signature

[sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Ryan Kelly
. -Ryan Kelly -- 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

Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Ryan Kelly
On Thu, Oct 10/10/13, 2013 at 12:59:31PM -0400, Michael Bayer wrote: On Oct 10, 2013, at 8:34 AM, Ryan Kelly rpkell...@gmail.com wrote: Hi: One of our applications is generating the following error: NoSuchColumnError: Could not locate column in row for column

[sqlalchemy] Why does Inspector.from_engine cause ROLLBACK to be issued?

2013-06-27 Thread Ryan Kelly
to Inspector.from_engine, and inside I see this: if self.engine is bind: # if engine, ensure initialized bind.connect().close() It seems to be the cause of the ROLLBACK. I'm not sure why this is necessary. Thoughts? -Ryan -- You received this message because you are subscribed to the Google Groups

Re: [sqlalchemy] Why does Inspector.from_engine cause ROLLBACK to be issued?

2013-06-27 Thread Ryan Kelly
be conditionalized. On Jun 27, 2013, at 3:05 PM, Ryan Kelly rpkell...@gmail.com wrote: Attempting to use Inspector.from_engine to get a list a table names from the database. Running the test suite of a large program I found that my data would disappear. After digging around in my own code for a few

Re: [sqlalchemy] Why does Inspector.from_engine cause ROLLBACK to be issued?

2013-06-27 Thread Ryan Kelly
around with it and see what happens. On Jun 27, 2013, at 5:26 PM, Ryan Kelly rpkell...@gmail.com wrote: On Thu, Jun 06/27/13, 2013 at 05:14:30PM -0400, Michael Bayer wrote: what kind of pooling are you using? StaticPool. I'm creating temporary tables over the connection and without

Re: [sqlalchemy] HSTORE serialize/de-serialize incorrectly handles backslashes

2013-06-26 Thread Ryan Kelly
On Tue, Jun 06/25/13, 2013 at 02:47:18PM -0400, Michael Bayer wrote: On Jun 25, 2013, at 2:13 PM, Ryan Kelly rpkell...@gmail.com wrote: There are also some other parsing problems that I consider to be corner cases and broken as implemented in PostgreSQL, such as: (postgres@[local

[sqlalchemy] HSTORE serialize/de-serialize incorrectly handles backslashes

2013-06-25 Thread Ryan Kelly
:10:12) [dev] select ',=,'::hstore; None of which are parsed by SQLAlchemy but some of which are parsed by PostgreSQL. You can see the bug report I filed about some of them here: http://www.postgresql.org/message-id/20120426190513.gb31...@llserver.lakeliving.com -Ryan P. Kelly -- You received

[sqlalchemy] Forcing a connection recycle/refresh

2013-06-21 Thread Ryan Kelly
to trigger a connection recycle given a session? -Ryan P. Kelly -- 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

[sqlalchemy] [BUG][PATCH] Function names not quoted when necessary

2013-06-06 Thread Ryan Kelly
) session.query(bug).all() ProgrammingError: (ProgrammingError) syntax error at or near ? LINE 1: SELECT A Bug?(1) AS A Bug?_1 'SELECT A Bug?(%(A Bug?_2)s) AS A Bug?_1' {'A Bug?_2': 1} -Ryan P. Kelly -- You received this message because you are subscribed to the Google Groups sqlalchemy group

Re: [sqlalchemy] custom __init__ methods not being invoked

2013-02-13 Thread Ryan McKillen
. the objects were detached, and were add()ed back into the session, but this still implies that #1 or #2 were true for a previous Session. On Feb 12, 2013, at 5:29 PM, Ryan McKillen ryan.mckil...@gmail.com wrote: It doesn't appear that the method decorated by @orm.reconstructor is called

Re: [sqlalchemy] custom __init__ methods not being invoked

2013-02-12 Thread Ryan McKillen
is called. So if I need it to be executed in a relationship-loading situation, what's the best way to go about it? Thanks. — RM On Mon, Jan 7, 2013 at 3:36 AM, Ryan McKillen ryan.mckil...@gmail.comwrote: Worked like a charm. Thanks. — RM On Mon, Jan 7, 2013 at 6:26 PM, Michael van Tellingen

[sqlalchemy] [BUG] [PATCH] Calling yield_per followed by execution_options results in AttributeError

2013-02-07 Thread Ryan Kelly
'union' Attached is a patch with a test case. -Ryan Kelly -- 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

[sqlalchemy] SOME/ANY/ALL in postgres?

2013-01-11 Thread Ryan Kelly
this: from sqlalchemy.sql.expression import func, literal, not_ session.query(foo).filter(not_(literal(1) == func.all(foo.c.bar))) But I should really ask here for help because I've loaded the foot-gun completely full. So, what's the correct way to do this? -Ryan Kelly -- You received

Re: [sqlalchemy] custom __init__ methods not being invoked

2013-01-07 Thread Ryan McKillen
Worked like a charm. Thanks. — RM On Mon, Jan 7, 2013 at 6:26 PM, Michael van Tellingen michaelvantellin...@gmail.com wrote: See http://docs.sqlalchemy.org/en/latest/orm/mapper_config.html#constructors-and-object-initialization On Mon, Jan 7, 2013 at 4:47 AM, RM ryan.mckil...@gmail.com

Re: [sqlalchemy] Custom SQL construct for postgres multirow insert

2012-11-27 Thread Ryan Kelly
On Tue, Nov 27, 2012 at 11:00:25AM -0500, Michael Bayer wrote: On Nov 27, 2012, at 8:10 AM, Idan Kamara wrote: Hello, I'd like to create a construct for postgres's multirow insert. I asked this on IRC and got some great help from supplicant, however I have a few things missing:

Re: [sqlalchemy] Computed Columns

2012-10-16 Thread Ryan Kelly
))) + func.sin(func.radians(literal(origin_lat))) * func.sin(func.radians(markers.lat)) ) query = ( session.query(markers.lat, markers.lng, distance.label(distance)) .having(distance literal(25)) .order_by(distance) .limit(20) ) -Ryan Kelly -- You received

[sqlalchemy] yield_per but with Session.execute or select()?

2012-09-19 Thread Ryan Kelly
postgresql 9.1 and psycopg2, FWIW. -Ryan Kelly -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com

Re: [sqlalchemy] Aliasing a constant within a recursive CTE

2012-07-09 Thread Ryan Kelly
://docs.sqlalchemy.org/en/rel_0_7/core/expression_api.html#sqlalchemy.sql.expression.literal as column specs, but with no luck so far. -Ryan Kelly -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

Re: [sqlalchemy] [PATCHES] _compiler_dispatch in visit_delete and FROM ONLY support for postgres

2012-06-10 Thread Ryan Kelly
for the _compiler_dispatch in visit_delete/visit_update, and the other for implementing FROM ONLY using hints. Pretty similar to your patch but with some fixes to make it work with UPDATE and DELETE as well as proper tests and documentation. -Ryan Kelly On Jun 9

Re: [sqlalchemy] [PATCH] MATCH clause implementation for foreign keys

2012-06-10 Thread Ryan Kelly
sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -Ryan Kelly -- You received

Re: [sqlalchemy] [PATCHES] _compiler_dispatch in visit_delete and FROM ONLY support for postgres

2012-06-09 Thread Ryan Kelly
On Sat, May 05, 2012 at 08:00:20PM -0400, Michael Bayer wrote: On May 5, 2012, at 7:33 PM, Ryan Kelly wrote: List: I am currently trying to add support for FROM ONLY to the postgresql dialect. FROM ONLY is used when you wish to query a table which has other tables that inherit from

[sqlalchemy] [PATCH] MATCH clause implementation for foreign keys

2012-06-09 Thread Ryan Kelly
All: The attached patch implements the MATCH keyword for foreign keys. This is part of the SQL92 standard, and is supported by PostgreSQL and Oracle. Feedback welcome. -Ryan Kelly -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Postgresql 8.4 DB Permission and FOR SHARE OF locking problem when inserting into table A that has foreign key to table B while user accessing AB has only select rights to B

2012-06-07 Thread Ryan D
? All the best, Ryan -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit

Re: [sqlalchemy] Removing duplicates

2012-05-08 Thread Ryan Kelly
/msg/sqlalchemy/-/xnt0Zo5tSPUJ. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -Ryan -- You

[sqlalchemy] [PATCHES] _compiler_dispatch in visit_delete and FROM ONLY support for postgres

2012-05-05 Thread Ryan Kelly
in feedback on whether or not I'm headed in the right direction with it. It also depends on the first patch. Also, is this the right list? -Ryan Kelly [1] http://www.globalnerdy.com/2010/05/09/new-programming-jargon/ -- You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Getting ENUM-like behavior from a MySQL VARCHAR

2011-11-09 Thread Ryan
I have a MySQL VARCHAR column, but I'd like to get ENUM-like behavior at the ORM level. I'm using the declarative style. Here's what I've got so far: language = Column(Enum('en', 'fr', native_enum=False), CheckConstraint(), default='en') Docs say that when native_enum is set to False, uses

[sqlalchemy] Is Session.execute SQL injection safe?

2011-02-28 Thread Ryan
Can't find anything in the docs as to whether query strings passed into Session.execute are escaped/safe from SQL injection. Any insights? Thanks. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

Re: [sqlalchemy] Is Session.execute SQL injection safe?

2011-02-28 Thread Ryan McKillen
Great. Thank you. On Mon, Feb 28, 2011 at 9:37 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Feb 28, 2011, at 5:35 PM, Ryan wrote: Can't find anything in the docs as to whether query strings passed into Session.execute are escaped/safe from SQL injection. Any insights? Thanks

Re: [sqlalchemy] self-referential relationship w/ declarative style

2011-02-22 Thread Ryan McKillen
I added that in because without it I get: TypeError: Incompatible collection type: User is not list-like On Tue, Feb 22, 2011 at 6:47 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Feb 22, 2011, at 9:03 PM, Ryan McKillen wrote: Mike, thanks a lot. Big help. I'm almost

Re: [sqlalchemy] self-referential relationship w/ declarative style

2011-02-22 Thread Ryan McKillen
22, 2011, at 9:59 PM, Ryan McKillen wrote: I added that in because without it I get: TypeError: Incompatible collection type: User is not list-like On Tue, Feb 22, 2011 at 6:47 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Feb 22, 2011, at 9:03 PM, Ryan McKillen wrote: Mike, thanks

[sqlalchemy] self-referential relationship w/ declarative style

2011-02-20 Thread Ryan
I'm attempting a self-referential mapping on a Client object that includes these two columns: id = Column(Integer, primary_key=True) inviter_id = Column(Integer, ForeignKey('users.id'), nullable=True) Started here with no luck: inviter = relationship('Client', primaryjoin='Client.id ==

[sqlalchemy] MapperExtension#after_insert behavior

2011-02-03 Thread Ryan
I'm using MapperExtension#after_insert and realizing that this callback fires when a record has been inserted into a transaction, but before the session is actually committed. I'd like an after_insert callback that fires after commit/once the record physically resides in the database. Any

[sqlalchemy] Re: mappers failed to initialize/class name is not defined

2011-01-25 Thread Ryan
Problem solved. Had to to with my setup, unrelated to SQLAlchemy. Sorry! -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to

[sqlalchemy] mappers failed to initialize/class name is not defined

2011-01-24 Thread Ryan
I'm using the declarative style and unable to to get a mapper to initialize. Here's a simplified version of the class from client_transaction.py: class ClientTransaction(Base): __tablename__ = 'client_transactions' id = Column(Integer, primary_key=True) client_promotion_id =

[sqlalchemy] Re: Can SQLAlchemy's ORM do this?

2010-06-21 Thread Ryan I.
On Jun 21, 10:02 pm, Michael Bayer mike...@zzzcomputing.com wrote: yes please see the polymorphic association example included in the distribution . Thanks! It seems there's nothing SQLAlchemy can't do :). Btw, since the examples are a bit complicated, here is just for reference in case

[sqlalchemy] Re: Circular Dependancy Hell

2009-09-28 Thread Ryan Michael
='thumbnail_id')) Thanks again, you saved my sanity. -Ryan On Sep 26, 3:17 pm, Mike Conley mconl...@gmail.com wrote: You need to use argument            post_update=True on your thumbnails relation http://www.sqlalchemy.org/docs/05/mappers.html#rows-that-point-to-the... http://www.sqlalchemy.org/docs

[sqlalchemy] Circular Dependancy Hell

2009-09-25 Thread Ryan Michael
circular dependancy errors. Can someone help me understand what's going wrong? Thanks -Ryan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

[sqlalchemy] Re: persistent result set

2008-11-07 Thread Adam Ryan
OK, thank you. But one last thought: Is storing the query rather than the result really the way? I mean, after a couple dozen complex, expensive change operations, the user could end up with only 4 records. It would be more efficient to just store the indexes rather than redo all the queries

[sqlalchemy] Re: persistent result set

2008-11-06 Thread Adam Ryan
= query.all() If instead I stored the query object, how would I then and_ and or_ it? Thanks a lot Michael. This is extremely helpful and gracious. - Adam On Nov 6, 3:15 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Nov 6, 2008, at 12:28 AM, Adam Ryan wrote: I can't store the query object

[sqlalchemy] Re: correlated update across logical databases

2008-07-21 Thread Ryan Tracey
Hi Michael 2008/7/18 Michael Bayer [EMAIL PROTECTED]: On Jul 18, 2008, at 9:37 AM, Ryan Tracey wrote: sqlalchemy.exc.NoSuchTableError: manufacturer Just to sum up: dbengine = create_engine('mysql://u:[EMAIL PROTECTED]/schema1') meta = MetaData() meta.bind = dbengine Table('tableX

[sqlalchemy] Re: correlated update across logical databases

2008-07-18 Thread Ryan Tracey
Hi Michael 2008/7/17 Michael Bayer [EMAIL PROTECTED]: On Jul 17, 2008, at 7:12 AM, Ryan Tracey wrote: Hi I would like to do a correlated update involving tables located in two logical databases on the same MySQL server. The commented out code below would work except that the mysql

[sqlalchemy] Re: correlated update across logical databases

2008-07-18 Thread Ryan Tracey
Hi Michael 2008/7/17 Michael Bayer [EMAIL PROTECTED]: On Jul 17, 2008, at 7:12 AM, Ryan Tracey wrote: Hi I would like to do a correlated update involving tables located in two logical databases on the same MySQL server. The commented out code below would work except that the mysql

[sqlalchemy] correlated update across logical databases

2008-07-17 Thread Ryan Tracey
and sdf_customer.WholesalerID=fc.WholesalerID) where sdf_customer.StatusID in (8, 12) and sdf_customer.FileID in %s % (file_ids_str,) rc = dbengine.execute(sql).rowcount Any help would be much appreciated. Regards, Ryan -- Ryan Tracey Citizen: The World

[sqlalchemy] Can't reconnect until invalid transaction is rolled back after application sits idle overnight.

2008-07-11 Thread Ryan Parrish
Using SQLAlchemy 0.4.4 I am having a problem with SQLAlchemy where after the application that uses SQLAlchemy has been sitting overnight and a user makes the first queries of the day thru the app that uses SA, SQLAlchemy throws an error saying 'MySQL server has gone away', which I understand the

[sqlalchemy] Re: Can't reconnect until invalid transaction is rolled back after application sits idle overnight.

2008-07-11 Thread Ryan Parrish
On Jul 11, 10:03 am, Michael Bayer [EMAIL PROTECTED] wrote:. The reason you're getting the disconnect exception in the first place   is because the pool_recycle feature only works upon checkout from the   pool.  So the solution is the same, ensure all connections are   returned to the pool

[sqlalchemy] Re: Using custom functions and threading (v. 0.4.6)

2008-07-02 Thread Ryan Ginstrom
[mailto:[EMAIL PROTECTED] On Behalf Of Ryan Ginstrom If I start my method calls with begin() would I be able to create functions in the connection object, then use my session object to run queries? Founds this one out for myself: no, it doesn't work g Regards, Ryan Ginstrom

[sqlalchemy] Using custom functions and threading (v. 0.4.6)

2008-07-01 Thread Ryan Ginstrom
approach? Thanks in advance for any enlightenment. Regards, Ryan Ginstrom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com

[sqlalchemy] Re: Using custom functions and threading (v. 0.4.6)

2008-07-01 Thread Ryan Ginstrom
in the connection object, then use my session object to run queries? Regards, Ryan Ginstrom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

[sqlalchemy] Re: Why is explicit 'and_' required for filter but not filter_by?

2007-09-15 Thread Ryan
And whatever happened to the nice select_by Query method where I could mix filter-type criterion arguments and filter_by-type keyword arguments in one call. *That* was readable to me, and very usable in a pythonic way. What's wrong with having one filter method that does everything? Python

[sqlalchemy] Why is explicit 'and_' required for filter but not filter_by?

2007-09-13 Thread Ryan Fugger
In 0.4: Is there any reason that I (as far as i can tell) need an explicit 'and_' to use multiple parameters with Query.filter, as opposed to filter_by, where I don't need an explicit 'and_'? I think the latter is cleaner. Ryan --~--~-~--~~~---~--~~ You received

[sqlalchemy] Selecting objects with null foreign keys

2007-04-09 Thread Ryan
would be cleaner, since I could just pass a 'host' variable that may be None without having to check it manually first before getting its id (however simple that might be). Thanks. Ryan --~--~-~--~~~---~--~~ You received this message because you are subscribed