[sqlalchemy] sqlacodegen --noclaases depracated?

2023-10-23 Thread Peter Daniels
recognized arguments: --noclasses How can I get it to just gen some tables? This is what I read in the project docs: "Unless the --noclasses option is used, sqlacodegen tries to generate declarative model classes from each table." From: https://pypi.org/project/sqlacodegen/ Thanks! -P

Re: [sqlalchemy] Modifying Query Object

2023-04-14 Thread Peter Harrison
I have some additional context on the issue Luis mentioned. 1. We are using the graphene-sqlalchemy package. 2. When you do a GraphQL web api query, the package creates a sqlalchemy.orm.query.Query object. 3. We want to modify this standard query that the package creates so that

Re: [sqlalchemy] Modifying Query Object

2023-04-14 Thread Peter Harrison
ert the func.max Getting a solution to this will help the graphene-sqlalchemy team create better documentation. Peter On Tue, Apr 11, 2023 at 4:59 PM S Mahabl wrote: > Do you get many rows? > > SELECT date_format(data.timestamp, "%Y-%m-%d %H"), max(data.value) AS

Re: [sqlalchemy] Modifying Query Object

2023-04-14 Thread Peter Harrison
ert the func.max Getting a solution to this will help the graphene-sqlalchemy team create better documentation. Peter On Tue, Apr 11, 2023 at 4:59 PM S Mahabl wrote: > Do you get many rows? > > SELECT date_format(data.timestamp, "%Y-%m-%d %H"), max(data.value) AS

Re: [sqlalchemy] Query object modification

2023-04-13 Thread Peter Harrison
Thanks Mike, Ideally we'd prefer to find a solution via Graphene-SQLAlchemy. Unfortunately we don't have the luxury of creating our own query when interacting with Graphene-SQLAlchemy. So the key question for us is, can you modify an existing sqlalchemy.orm.query.Query object to insert a "func

Re: [sqlalchemy] Using Mapped[str | None]

2022-08-31 Thread Peter Schutt
one of the nice ergonomic improvements to typing of late. Cheers:) On Wednesday, 31 August 2022 at 23:32:37 UTC+10 Mike Bayer wrote: > > > On Wed, Aug 31, 2022, at 5:00 AM, Peter Schutt wrote: > > Hi, > > I've been using 2.0 from main and notice that annotating an attribute

[sqlalchemy] Using Mapped[str | None]

2022-08-31 Thread Peter Schutt
Hi, I've been using 2.0 from main and notice that annotating an attribute with `mapped[str | None]` raises with: sqlalchemy.exc.ArgumentError: Could not locate SQLAlchemy Core type for Python type: str | None I've been able to get it to work with a couple of mods in util.typing and orm.proper

Re: [sqlalchemy] ".contains" query with VARBINARY Column

2022-07-13 Thread Peter Harrison
. ColumnOperators.startswith() I created this issue with suggested text https://github.com/sqlalchemy/sqlalchemy/issues/8253 Peter On Wed, Jul 13, 2022 at 6:09 AM Mike Bayer wrote: > you're sending a Python bytestring as the expression for which there's no > explicit support for opera

[sqlalchemy] ".contains" query with VARBINARY Column

2022-07-12 Thread Peter Harrison
enabled = Column(BIT(1), default=1) ts_modified = Column( DateTime, nullable=False, default=datetime.datetime.utcnow, onupdate=datetime.datetime.now) ts_created = Column( DateTime, nullable=False, default=datetime.datetime.utcnow) Peter -- SQLAlchemy - The Pytho

Re: [sqlalchemy] Integrating graphene-sqlalchemy-filter into graphene-sqlalchemy

2022-03-30 Thread Peter Harrison
nated. sqlalchemy and graphene-sqlalchemy have been life savers for me, and I'd like to contribute financially to the combined health of both. If you are a user of the graphene-sqlalchemy-filter package and are interested, please contact me off list. Thanks for your understanding. Peter On W

[sqlalchemy] Integrating graphene-sqlalchemy-filter into graphene-sqlalchemy

2022-03-30 Thread Peter Harrison
Hello everyone, My organization uses both graphene-sqlalchemy and graphene-sqlalchemy-filter for some subsystems. Unfortunately development in graphene-sqlalchemy-filter has stalled and does not support the latest version of graphene which supports nifty batching. The graphene-sqlalchemy-filte

[sqlalchemy] SQLAlchemy exasol dialect maintainership transfer to Exasol AG

2022-01-27 Thread Peter Hoffmann
this development and have transferred the git repository to it's new home https://github.com/exasol/sqlalchemy-exasol. We will also transfer pypi access to sqlalchemy-exasol. The exasol team will provide an official announcement within the next days. Kind Regards, Peter Hoffmann Blue Y

[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 = declarative_ba

[sqlalchemy] Pyodbc creator function ignored in create_engine (mssql)

2020-05-22 Thread Peter Lai
example: import pyodbc from sqlalchemy import create_engine def creator(): config = { 'driver': 'ODBC Driver 13 for SQL Server', 'host': 'localhost', 'port': 1433, 'user': 'me', 'pw': 'mypw', 'dbname': 'mydb' } return pyodbc.connec

Re: [sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-25 Thread Peter Schutt
ike this helps as I go through the documentation. > Thanks very much much for your patient assistance. > > On Sunday, August 25, 2019 at 9:35:28 PM UTC-4, Peter Schutt wrote: >> >> HI Ira, >> >> Again, that is an error that originates from inside the database lay

Re: [sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-25 Thread Peter Schutt
contact.first_name AS civicrm_contact_first_name, > civicrm_address.street_address AS civicrm_address_street_address, > civicrm_address.city AS civicrm_address_city, civicrm_address.postalcode AS > civicrm_address_postalcode, civicrm_state_province.name AS > civicrm_state_province_n

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-22 Thread Peter Schutt
Some time between yesterday and today you have switched python interpreters between 2.7 and 3.6. Yesterday your errors were originating from modules located in "/Users/ihf/anaconda2/lib/python2.7/", today they seem to be coming from "~/anaconda2/lib/python3.6/". To be honest, it's better if you

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-22 Thread Peter Schutt
ialect_kwargs(self, kwargs)287 raise > TypeError(288 "Additional arguments should be "--> > 289 "named _, got '%s'" % k290 > )291 dialect_name, arg_name = m.group(1,

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-21 Thread Peter Schutt
, I didn't close the parenthesis for the placeholders example, should read: "(e.g. `%(tag_id_2)s`) are passed...". Couldn't find a way to edit the original. On Thursday, 22 August 2019 10:43:17 UTC+10, Peter Schutt wrote: > > Hi Ira, > > For example Integer(xx) sa

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-21 Thread Peter Schutt
>>>> last_name = Column(String(20), nullable=False) >>>> first_name = Column(String(20), nullable=False) >>>> class Contribution(Base): >>>> __tablename__ = "civicrm_contribution" >>>> id = Column(Integer, primary_ke

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-19 Thread Peter Schutt
I wasn't > able to get the query I posted to work due to a syntax error (probably > having to do with the quotes). I have not mapped any tables to classes. > > On Sunday, August 18, 2019 at 8:54:57 PM UTC-4, Peter Schutt wrote: >> >> Hi Ira, I'd be happy to hel

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-18 Thread Peter Schutt
Hi Ira, I'd be happy to help you find your feet with the SQLAlchemy ORM. In general when creating an application that uses the SQLAlchemy ORM, you would start with an Engine (for connecting to the db), a declarative base class (maps db table to python class) and a Session instance (for using a

Re: [sqlalchemy] loss of precision when retrieving DATETIME2 column from MSSQL

2019-07-29 Thread peter bell
ure I can workaround this (but just thought I'd let you know) Example code below. Regards, Peter from sqlalchemy import (create_engine, TypeDecorator, String, Integer, event, MetaData, cast) from sqlalchemy.dialects.mssql import DATETIME2 from sqlalchemy.schema import (Tab

Re: [sqlalchemy] loss of precision when retrieving DATETIME2 column from MSSQL

2019-07-18 Thread peter bell
gDate class explicitly to the 'created' column using table reflection : t = Table('t', meta, Column('created', StringDate),autoload=True, autoload_with=engine) Is there a way to apply such a transformation to all DATETIME2 columns by default, without explicitly nam

Re: [sqlalchemy] loss of precision when retrieving DATETIME2 column from MSSQL

2019-07-18 Thread peter bell
You are correct - it seems the issue is in pyodbc I installed pymssql and used that when creating the sqlalchemy engine object. The DATETIME2 column is now mapped to a string (which has all 7 digits preserved) Thanks for your help, br Peter So this : from sqlalchemy import * URL = "

Re: [sqlalchemy] loss of precision when retrieving DATETIME2 column from MSSQL

2019-07-18 Thread peter bell
s of a query to a data type other than Python's datetime.datetime ? regards Peter On Thursday, 18 July 2019 13:02:16 UTC+3, Simon King wrote: > > I've never used SQL Server or ODBC, but I wonder if this is a pyodbc > issue: > > https://github.com/mkleehammer/pyodbc/issues

[sqlalchemy] loss of precision when retrieving DATETIME2 column from MSSQL

2019-07-18 Thread peter bell
I am new to sqlalchemy and I am trying to retrieve results from a table containing a DATETIME2 column in a SQL Server database. A SQL Server DATETIME2 column includes a seven-digit number from 0 to 999 that represents the fractional seconds. When I retrieve the results of the table into s

[sqlalchemy] Re: Possible regression?

2019-04-28 Thread peter . m . schutt
Hi Lyla, I notice Head.id is defined as String: >     id = Column(String, primary_key=True) While TasselThread.head_id is defined as Integer: >     head_id = Column(Integer, ForeignKey('head.id'), nullable=False) Could it be that causes the merge to not recognize the existing instance and a n

[sqlalchemy] test/dialect/test_sqlite.py::TypeReflectionTest::()::test_round_trip_direct_type_affinity fails

2018-06-22 Thread Hans-Peter Jansen
Hi %, packaging 1.2.8 (and before) fails for openSUSE Tumbleweed, while it succeeds for many former distributions due to a single failing test with Python 2.7.15, sqlite 3.24, pytest 3.6.0: FAIL test/dialect/test_sqlite.py::TypeReflectionTest:: ()::test_round_trip_direct_type_affinity Full log

Re: [sqlalchemy] Any way to suppress CASTs during Concrete Inheritance unions on Oracle ?

2018-06-13 Thread Peter Lai
On Wednesday, June 13, 2018 at 8:28:32 PM UTC-4, Mike Bayer wrote: > > On Wed, Jun 13, 2018 at 7:44 PM, Peter Lai > wrote: > > I've implemented a Concrete inheritance model and Oracle 11g is balking > on > > `CAST(NULL AS CLOB) as fieldn` during the pjoin

[sqlalchemy] Any way to suppress CASTs during Concrete Inheritance unions on Oracle ?

2018-06-13 Thread Peter Lai
I've implemented a Concrete inheritance model and Oracle 11g is balking on `CAST(NULL AS CLOB) as fieldn` during the pjoin union query execution with: ORA-00932: inconsistent datatypes: expected - got CLOB This happens when the unioned tables representing the 2 subclasses have different `Text`

Re: [sqlalchemy] How to create multiple TABLES and INSERTS programatically ?

2018-04-03 Thread Peter Lai
I wonder if one can also do this with Declarative Base classes using `type` construction? Like, to dynamically create a Declarative Class from some pre-defined namespace dicts: Base = declarative_base() metas = [{'__tablename__': 'footable'}, ...] columns = [{ 'key': 'field1', 'type': Text}, .

[sqlalchemy] Differentiate what raised IntegrityError (fkey not found vs. duplicate pkey)

2018-03-20 Thread Peter Lai
I'm implementing a recursive upsert operation for an object whose primary key also contains a foreignkey, and I'd like to get some more info from IntegrityError, namely whether integrity was violated because the foreignkey didn't exist (yet) or I am trying to insert a duplicate pkey. In the for

[sqlalchemy] Re: base class not inserting correctly on subclass insertion (joined table inheritance)

2018-03-20 Thread peter . lai
Yeah it took me about 3 hours to realize that in my actual code, I made a typo in the __init__ so that I was assigning the uuid to the wrong attribute/column. So embarassing :( On Monday, March 19, 2018 at 11:04:04 PM UTC-4, Peter Lai wrote: > > As seen at: > https://stackove

Re: [sqlalchemy] [alembic] Batch migrations with sqlite and naming conventions

2017-04-16 Thread Peter Erickson
e are likely more bugs on the Alembic side to be fixed. On 04/11/2017 10:58 PM, Peter Erickson wrote: I'm sure that I'm missing a subtle point with batch migrations and naming conventions for SQLite databases, but I can't figure out what I'm doing wrong. After renaming

[sqlalchemy] [alembic] Batch migrations with sqlite and naming conventions

2017-04-11 Thread Peter Erickson
I'm sure that I'm missing a subtle point with batch migrations and naming conventions for SQLite databases, but I can't figure out what I'm doing wrong. After renaming a table, I'm using a batch migration to update a foreign key in a child table. However, after recreating the child table 2 CHEC

[sqlalchemy] Postgrsql Array of CIDR and return type as String

2016-02-03 Thread Peter Hudec
f I change the column type to CIDR ARRAY I get (, "'{127.0.0.1/32,::1/128}'") postgresl version: 9.4 /debian jessie/ python: 2.7.9 bottle (0.12.9) bottle-pgsql (0.2) bottle-sqlalchemy (0.4.3) psycopg2 (2.6.1) SQLAlchemy (1.0.11) Please could anybody help me why the ARRAY of C

[sqlalchemy] Obtaining the SQL query for a lazy load programmatically

2014-10-27 Thread Peter Waller
ere is a way to avoid doing that. Thanks, - Peter -- 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

Re: [sqlalchemy] Serializing sqlalchemy declarative instances with yaml

2014-10-24 Thread Peter Waller
le %s objects" % base.__name__ 71 state = base(self) 72 args = (self.__class__, base, state) TypeError: can't pickle int objects On 24 October 2014 17:55, Jonathan Vanasco wrote: > > On Friday, October 24, 2014 10:39:43 AM UTC-4, Peter Waller wrote: >>

Re: [sqlalchemy] Serializing sqlalchemy declarative instances with yaml

2014-10-24 Thread Peter Waller
Well I was hoping to "just use yaml" since yaml understands when two objects refer to the same underlying object. That means you don't have to write any logic to de-duplicate objects through relationships, etc. Since json doesn't have the notion of referencing, that doesn't seem straightforward th

[sqlalchemy] Serializing sqlalchemy declarative instances with yaml

2014-10-23 Thread Peter Waller
`Foo.__reduce_ex__(2)` gives `TypeError: can't pickle int objects`. As does `declarative_base().__reduce_ex__(2)`. I note that `pickle.dumps` works. But we'd rather use YAML. Where is the bug? Is it in sqlalchemy, yaml, or python? Thanks, - Peter -- You received this message because

Re: [sqlalchemy] A complicated composite secondary join relationship() property involving four tables

2014-10-20 Thread Peter Waller
for primary join condition '"ActionMeaning"."ActionID" = "PersonAction"."ActionID"' on relationship PersonAction.meaning. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or are annotated in the join condition with the

Re: [sqlalchemy] A complicated composite secondary join relationship() property involving four tables

2014-10-20 Thread Peter Waller
nit I would just have Person. Would that simplify the relationships? I'll have a play around with this and see where I get. Thanks, - Peter * http://docs.sqlalchemy.org/en/rel_0_9/orm/mapper_config.html#maptojoin On 20 October 2014 18:26, Michael Bayer wrote: > >> On Oct 20, 2014

[sqlalchemy] A complicated composite secondary join relationship() property involving four tables

2014-10-20 Thread Peter Waller
uture: Composite relationship between multiple tables Joining multiple tables in a relationship relationship secondary join primaryjoin secondaryjoin Thanks, - Peter -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this

[sqlalchemy] Search/Filter using M2M relationships

2014-10-16 Thread Peter Petersky
or some tag (http://127.0.0.1:5000/admin/connection/?flt1_24=Dead) leads to: sqlalchemy.exc.InvalidRequestError sqlalchemy.exc.InvalidRequestError: Could not find a FROM clause to join from. Tried joining to tag, but got: Can't find any foreign key relationships between 'connect

[sqlalchemy] senseless warning messages escape python logging

2014-07-02 Thread Hans-Peter Jansen
Dear SQLAchemistas, this is an issue, that my apps choke on from time to time, _related_ to SQLA. Although, logging is set up correctly, some operations spit out senseless warning messages like this: /usr/lib/python2.6/site-packages/sqlalchemy/engine/default.py:324: Warning: Data truncated fo

Re: [sqlalchemy] Performance problem of simple orm usage

2014-06-29 Thread Hans-Peter Jansen
Dear Jonathan, thank you for your cool remix of recommendations. Very appreciated. On Donnerstag, 26. Juni 2014 15:09:03 Jonathan Vanasco wrote: > In case this helps... > > This reminds me slightly of some RFID work I did years ago. We had a lot > of reads coming in from different units, severa

Re: [sqlalchemy] Performance problem of simple orm usage

2014-06-29 Thread Hans-Peter Jansen
Hi Mike, sorry for the late reply, but it took a considerable amount of time to sort the non SQLA related issues out.. Will elaborate in a reply to Jonathan's answer a bit. On Donnerstag, 26. Juni 2014 17:34:58 Mike Bayer wrote: > On 6/26/14, 5:18 PM, Hans-Peter Jansen wrote: > &

Re: [sqlalchemy] Performance problem of simple orm usage

2014-06-26 Thread Hans-Peter Jansen
Dear Mike, sorry for not coping with preferred reply behavior.. On Donnerstag, 26. Juni 2014 15:26:02 Mike Bayer wrote: > On 6/26/14, 3:07 PM, Hans-Peter Jansen wrote: > > > > Obviously, some operation triggers the flush method with about the > > same consequences.. >

[sqlalchemy] Mapping lots of similar tables / database design

2014-04-01 Thread Peter Stensmyr
-arounds (such as not defining a foreign key), but it all seems like a big hack and I feel that there must be a better way of doing this. How should I organise and access my data? Any advice appreciated, Peter -- You received this message because you are subscribed to the Google Groups &qu

Re: [sqlalchemy] Dynamically map/reference to another table based on tablename

2013-11-05 Thread Peter Lim
specific Entity. Regards, Peter Lim On Wed, Nov 6, 2013 at 8:16 AM, Michael Bayer wrote: > > On Nov 3, 2013, at 5:41 AM, Peter wrote: > > Hi, > > I'm currently learning the how to set up a basic Entity System with > sqlalchemy. The entity system requirements are described

[sqlalchemy] Dynamically map/reference to another table based on tablename

2013-11-03 Thread Peter
Hi, I'm currently learning the how to set up a basic Entity System with sqlalchemy. The entity system requirements are described within this link: http://t-machine.org/index.php/2009/10/26/entity-systems-are-the-future-of-mmos-part-5/ Basically, an Entity that lives with the world is defined by

Re: [sqlalchemy] Modification tracking

2013-08-22 Thread Hans-Peter Jansen
On Donnerstag, 22. August 2013 23:58:17 Hans-Peter Jansen wrote: > Dear Michael, > Pardon, I'm using 0.8.2 ATM. > > Cheers, > Pete -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and

Re: [sqlalchemy] Modification tracking

2013-08-22 Thread Hans-Peter Jansen
Dear Michael, thanks for the detailed response. On Mittwoch, 21. August 2013 16:55:18 Michael Bayer wrote: > On Aug 21, 2013, at 12:40 PM, Hans-Peter Jansen wrote: > > Hi, > > > > being new to SQLAlchemy, I try to get my way through it. > > > > In an applicati

[sqlalchemy] Modification tracking

2013-08-21 Thread Hans-Peter Jansen
Hi, being new to SQLAlchemy, I try to get my way through it. In an application, I have rather elaborate needs to track changes. I've defined 3 classes with declarative, where the main class has relationships with two auxiliary classes, that refer to the main class with foreign references. All

Re: [sqlalchemy] 0.7.10 build test failures

2013-07-15 Thread Hans-Peter Jansen
On Montag, 15. Juli 2013 13:19:55 Michael Bayer wrote: > issue http://www.sqlalchemy.org/trac/ticket/2782 is added to merge this to > all three branches patch for 0.7 attached to the ticket. tested-by: Hans-Peter Jansen Thanks, Mike. This nice experience will encourage me to report som

Re: [sqlalchemy] 0.7.10 build test failures

2013-07-14 Thread Hans-Peter Jansen
On Sonntag, 14. Juli 2013 17:38:12 Michael Bayer wrote: > you can get that right here: > > www.sqlalchemy.org/changelog/CHANGES_0_7_11 Thanks, great. That fixed all tests, but this is left still: [ 156s] -- [ 156s] Ran 4075 t

Re: [sqlalchemy] 0.7.10 build test failures

2013-07-14 Thread Hans-Peter Jansen
Hi Mike, On Sonntag, 14. Juli 2013 17:03:14 Michael Bayer wrote: > hi Hans - > > this issue, a missing import that only triggers on certain platforms, has > been fixed in all branches since 0.7. But there's no 0.7.11 released > planned at this time. Thanks for the quick answer. Mind pointing

[sqlalchemy] 0.7.10 build test failures

2013-07-14 Thread Hans-Peter Jansen
Dear Mike, while building version 0.7.10 on openSUSE build service, I noticed, that there are a bunch of test failures to care about. My SQLAlchemy project: https://build.opensuse.org/package/show/home:frispete:python/python-SQLAlchemy The build logs are located here: https://build.opensuse.

[sqlalchemy] Re: Advice: Best practice for working with an existing database

2013-04-03 Thread Peter Herndon
On Friday, March 22, 2013 9:31:59 AM UTC-4, Jason wrote: > > > Hi Peter, > I think using a the declarative reflected style is a great way to > integrate an existing database into your application. It sounds like you > are doing this already, but in case you are not the r

[sqlalchemy] Advice: Best practice for working with an existing database

2013-03-18 Thread Peter Herndon
ment_column, columns, foreign_keys, indexes, and primary_key -- are there other table attributes I should be inspecting? Thanks for your advice! ---Peter -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop rec

Re: [sqlalchemy] How to identify that an InstrumentedAttribute or its ColumnProperty are read-only?

2012-12-12 Thread Peter Bunyan
Thank you so much. Wonderful! -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/wcjW6WJRVccJ. To post to this group, send email to sqlalchemy@googlegroups.com. To

[sqlalchemy] How to identify that an InstrumentedAttribute or its ColumnProperty are read-only?

2012-12-12 Thread Peter Bunyan
Much like FormAlchemy, I am trying to update my model from a post in a generic manner. I'd like to find out if an Attribute(InstrumentedAttribute) or its associated ColumnProperty is read-only. (please excuse ridiculous example) class Foo(Base): id = Column(Integer, primary_key=True)

[sqlalchemy] Object delegation and SA inheritance

2012-03-05 Thread Peter Erickson
Is is possible to set the polymorphic_on attribute on an object that is not directly tied to a db table, but has access to the db attribute via delegation? I have a generic Product class that processes an XML to obtain its generic attributes (uuid, type, etc). Afterwards, the product is encapsula

Re: [sqlalchemy] declarative and "late reflection"?

2011-12-27 Thread peter sabaini
Cool -- works nicely, thanks again! On Fri, Dec 23, 2011 at 2:56 AM, Michael Bayer wrote: > > On Dec 22, 2011, at 7:28 PM, Michael Bayer wrote: > > > this could work really nicely with extend_existing, which has been > enhanced in 0.7.4, but there seem to be some glitches preventing it from > bei

Re: [sqlalchemy] declarative and "late reflection"?

2011-12-22 Thread peter sabaini
gg/sqlalchemy/ext/declarative.py", line 1177, in _as_declarative if not table.c.contains_column(c): AttributeError: 'object' object has no attribute 'c' Hm, maybe I can try to add the column override later? Thanks again peter. On Thu, Dec 22, 2011 at 4:41 PM, Michael

[sqlalchemy] declarative and "late reflection"?

2011-12-22 Thread peter sabaini
enerate the class object later in a function when the engine is already available but maybe there's something more elegant... Many thanks, peter. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email t

[sqlalchemy] Re: eager/joined loading a whole graph

2010-10-05 Thread Peter Waller
anyway. - Peter On 5 October 2010 14:39, Peter Waller wrote: > Hi All, > > I have also created a post for this question on StackOverflow: > > http://stackoverflow.com/questions/3863508/joinedload-eager-loading-whole-sub-graphs-in-sqlalchemy > > Let's say I have a Task obj

[sqlalchemy] eager/joined loading a whole graph

2010-10-05 Thread Peter Waller
uot;) ]), ] ) def load_task() # How to eagerly load the whole task tree here? DBSession.query(Task).filter(name="MAKE_CHEESE").all() Thanks in advance, - Peter -- You received this message because you are subscribed to the Google Groups "

Re: [sqlalchemy] Expunge

2010-09-25 Thread Peter Hansen
rencing the session "go out of scope" does nothing if there are other non-local references to the same session. But you probably know all that. :) ) -- Peter Hansen -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to thi

Re: [sqlalchemy] Re: Serializable txns not useful on sqlite because do_begin() does nothing

2010-09-21 Thread Peter Hansen
t confuse too many people (for more than a few moments). +1 to that, as it would have saved me more than a few hours of troubleshooting a few weeks ago. -- Peter Hansen -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post t

[sqlalchemy] Re: SQLite: Rolling back DDL requests

2010-08-14 Thread Peter Hansen
e there's also some feature in sqlite3 itself (not the Python module) which can be configured for debug purposes to show what's really happening here.) -- Peter Hansen Engenuity Corporation -- You received this message because you are subscribed to the Google Groups "sqlalchemy&q

[sqlalchemy] Re: SQLite: Rolling back DDL requests

2010-08-13 Thread Peter Hansen
;use raw_connection with isolation_level None''' self.setup(connect_args={'isolation_level': None}) self.rollback_raw() self.assertEqual(['foo'], self.get_table_names()) def test03(self): '''use transacti

[sqlalchemy] Filtering based on Composite() value

2010-04-30 Thread Peter Erickson
Is it possible to use like() on a composite object attribute to filter a particular query? I'm trying to pull records in from a postgres db based on a the value of a single attribute within a composite object. For example, with the setup below, I want to search for records that have a url_d

[sqlalchemy] Re-using labels

2010-04-26 Thread Peter Waller
(my_column / :my_column_1 AS INTEGER) > :param_1 Is there any reason "fixed_column" is not re-used in the where statement? Is it possible to make this happen? It would make my statements much more readable. Thanks, - Peter -- You received this message because you are subscribed to the G

[sqlalchemy] Beware of DateTime and sqlite [Problem solved]

2010-01-11 Thread Peter
ime problem. It was fixed by changing the column type to unicode ( sqlite stores dates as strings ): transactions_table = Table('transactions', metadata, ... Column('enter_date', Unicode(50)) Conclusion: Be careful with da

[sqlalchemy] Differences in trivial queries between mysql and sqlite backend

2009-12-11 Thread Peter
h is therefore case insensitive) , but not in sqlite ( the latter seems to consider case ): accs = of_sqlalchemy.session.query(Account).filter_by(type='root').all() Is this behavior due to sqlalchemy ? From what I found on typical differences between mysql and sqlite, those above are not

Re: [sqlalchemy] clear_mappers does not really clear

2009-12-10 Thread Peter
Michael Bayer wrote: > On Dec 9, 2009, at 6:56 PM, Peter wrote: > > >> Hi >> >> I am sorry I misinterpreted the error message that I mentioned in my >> previous mail: >> >> InvalidRequestError: Table 'accounts' is already defined for th

[sqlalchemy] clear_mappers does not really clear

2009-12-09 Thread Peter
out dropping the tables in the database ) ? I tried this one: for table in metadata.sorted_tables: metadata.remove(table) but same problem. Any ideas ? Peter -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this gr

[sqlalchemy] clear_mappers does not really clear

2009-12-09 Thread Peter
lumns on an existing Table object. when I try to map a class to a table that has already been mapped , although I execute the two commands above before remapping. Thanks for your advice Peter -- You received this message because you are subscribed to the Google Groups "sqlalchemy" grou

Re: [sqlalchemy] Re: how to change a database

2009-12-07 Thread Peter
ema argument, you > can switch from one database to another. I normally have a table > initializer method that I can pass the schema argument to to handle > this functionality. > > > On Dec 3, 4:37 am, Peter wrote: > >> Hi >> >> Lets suppose I created an eng

Re: [sqlalchemy] how to change a database

2009-12-04 Thread Peter
chaouche yacine wrote: > Why not create a different engine for that database ? > > --- On Thu, 12/3/09, Peter wrote: > > Thanks a lot, I guess I still have to "abstract away" my standard sql behavior .. Peter -- You received this message because you are subscr

[sqlalchemy] how to change a database

2009-12-03 Thread Peter
#x27;) The former command succeeds with a warning ( already discussed on this list ) but the latter seems to be the wrong approach: ... 2009-12-03 13:28:39,221 INFO sqlalchemy.engine.base.Engine.0x...b0ec COMMIT TypeError: "'NoneType' object is not callable" in at 0x8821bc

[sqlalchemy] Warning: Can't create database 'TEST'; database exists

2009-11-23 Thread Peter
warning : /usr/lib/python2.5/site-packages/SQLAlchemy-0.5.6-py2.5.egg/sqlalchemy/engine/default.py:123: Warning: Can't create database 'TEST'; database exists cursor.execute(statement, parameters) Thanks for your help Peter -- You received this message because you are s

[sqlalchemy] Re: MySQL error

2009-03-23 Thread Peter Douma
Here is the code I am using MySQL_Python 1.2.3 with Python 2.6 db = create_engine('mysql://root:passw...@localhost/dbase', echo = True) metadata = MetaData() user = Table( 'user',metadata, Column('id' ,Integer, primary_key = True), Column('password' ,String, nullable = True

[sqlalchemy] Re: app memory leak - execute() with SA 0.5.2, PG 8.3, Psycopg2

2009-02-25 Thread Peter Hansen
ry usage. Although your workaround may not be generally useful, it would still be nice for posterity (i.e. those searching through this thread in future) if you could summarize how you've actually addressed this issue to your satisfaction, however

[sqlalchemy] Re: Cannot abort wxPython thread with SQLAlchemy

2008-06-11 Thread Peter Hansen
Dominique wrote: > On 10 juin, 02:38, Peter Hansen <[EMAIL PROTECTED]> wrote: >> As Python has no way to actually terminate a thread, can you explain >> what you mean by "stop this thread"? Are you simply cloning the code >> from the wxPython example, with

[sqlalchemy] Re: Cannot abort wxPython thread with SQLAlchemy

2008-06-09 Thread Peter Hansen
with the delayedresult.AbortEvent() object, and calling .set() on it? -Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegrou

[sqlalchemy] howto map python-class and stored procedures

2007-07-29 Thread peter
if it is possible to use getPerson instead of select...; and setPerson... instead of update? Thank you for your help. Best regards, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To

[sqlalchemy] Re: Sqlalchemy and py2exe...

2007-05-30 Thread Peter Damoc
PROBLEM SOLVED Thank you very much! Peter. On 5/30/07, Expo <[EMAIL PROTECTED]> wrote: > > > > > On 29 Mag, 18:07, pdamoc <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I've tried packing an app I've made with py2exe and run into > &

[sqlalchemy] Re: KeyError: 'inet'

2007-01-24 Thread Peter Nixon
On Wed 24 Jan 2007 00:37, Michael Bayer wrote: > no, youre testing it for me first :) Well it seems to work ok :-) Thanks -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc pgpAi1IpJWujj.pgp Description: PGP signature

[sqlalchemy] Re: KeyError: 'inet'

2007-01-23 Thread Peter Nixon
Hi There Thanks for the patch. It seems to fix the error. I will test it more over the following days. I see that you just released a new SA, but I dont see this patch in the changelog. Did it go in? Thanks Peter On Tue 16 Jan 2007 21:44, Michael Bayer wrote: > its quite easy to add t

[sqlalchemy] KeyError: 'inet'

2007-01-16 Thread Peter Nixon
n-sqlalchemy python-sqlalchemy-0.3.3-0.pm.1 # rpm -q python-psycopg2 python-psycopg2-2.0.2-10.1 Is there some way to make this work or do I need to go an find another database library to use Postgresql INET types with Python? Cheers -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc pgpjoEKtC0XSY.pgp Description: PGP signature