[sqlalchemy] sqlacodegen --noclaases depracated?

2023-10-23 Thread Peter Daniels
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! -Peter --

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)

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)

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

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

2022-08-31 Thread Peter Schutt
f 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 with

[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

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 operators like

[sqlalchemy] ".contains" query with VARBINARY Column

2022-07-13 Thread Peter Harrison
, nullable=False, default=datetime.datetime.utcnow) Peter -- 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 d

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

2022-03-30 Thread Peter Harrison
. 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 Wed, Mar 30

[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

[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 Yonder

[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] 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

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

2019-08-25 Thread Peter Schutt
elps 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 layer &

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

2019-08-25 Thread Peter Schutt
t; civicrm_entity_tag.entity_id AND civicrm_entity_tag.tag_id = %(tag_id_1)s > AND civicrm_contact.id = civicrm_address.contact_id AND > civicrm_address.state_province_id = civicrm_state_province.id AND > civicrm_address.country_id = civicrm_country.id AND > civicrm_contact.display

[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
guments should be "--> > 289 "named _, got '%s'" % k290 > )291 dialect_name, arg_name = m.group(1, 2) > TypeError: Additional arguments should be named _, got > 'ondelete' > > > On Wednesday, August 21, 2019 at 8:

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-21 Thread Peter Schutt
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) says that Integer

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-21 Thread Peter Schutt
irst_name = Column(String(20), nullable=False) >>>> class Contribution(Base): >>>> __tablename__ = "civicrm_contribution" >>>> id = Column(Integer, primary_key=True) >>>> contact_id = Column(Integer, nullable=False) >>&

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-19 Thread Peter Schutt
ted 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 help you find your feet with the SQLAlchemy ORM. >>

[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
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 (Table, Column

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

2019-07-18 Thread peter bell
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 naming them, as above ? br Peter

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/235 >

[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

[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

[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

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 pjo

[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

[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
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 a table, I'm using a batch migration to update a foreign key

[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

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

2016-02-03 Thread Peter Hudec
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 CIDR is not converted to the LIST? be

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

2014-10-27 Thread Peter Waller
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 this group, send email

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

Re: [sqlalchemy] Serializing sqlalchemy declarative instances with yaml

2014-10-24 Thread Peter Waller
UTC-4, Peter Waller wrote: I was also hoping to just use yaml to avoid writing custom dumping code, since it seems in general like a useful capability. So I may yet try and find the underlying bug and fix it. It might not be a bug, and the effect of an implementation feature of SqlAlchemy

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

2014-10-20 Thread Peter Waller
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 group and stop receiving emails from it, send an email

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

2014-10-20 Thread Peter Waller
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 mike...@zzzcomputing.com wrote: On Oct 20, 2014

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

2014-10-20 Thread Peter Waller
that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or are annotated in the join condition with the foreign() annotation. Any hints? Thanks again! On 20 October 2014 18:26, Michael Bayer mike...@zzzcomputing.com wrote: On Oct 20, 2014, at 1:14 PM, Peter Waller pe

[sqlalchemy] Search/Filter using M2M relationships

2014-10-16 Thread Peter Petersky
/ideas would be appreciated. Cheers, 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 this group, send

[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

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, several

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.. OK, turn off autoflush - either

[sqlalchemy] Mapping lots of similar tables / database design

2014-04-01 Thread Peter Stensmyr
advice appreciated, 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 this group, send email to sqlalchemy

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

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

[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

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 h...@urpla.net wrote: Hi, being new to SQLAlchemy, I try to get my way through it. In an application, I have rather elaborate

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 stop receiving emails from it, send

[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 h...@urpla.net Thanks, Mike. This nice experience will encourage me to report

[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:

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 me

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

[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 reflection setup

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

2013-03-18 Thread Peter Herndon
, 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 receiving emails from it, send

[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)

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] 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

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 mike...@zzzcomputing.comwrote: 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

[sqlalchemy] declarative and late reflection?

2011-12-22 Thread peter sabaini
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 to sqlalchemy@googlegroups.com. To unsubscribe from

Re: [sqlalchemy] declarative and late reflection?

2011-12-22 Thread peter sabaini
I can try to add the column override later? Thanks again peter. On Thu, Dec 22, 2011 at 4:41 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Dec 22, 2011, at 9:37 AM, peter sabaini wrote: Hey list, this sounds like it should be a FAQ, didn't find anything though: I want to use

[sqlalchemy] eager/joined loading a whole graph

2010-10-05 Thread Peter Waller
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 sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send

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

2010-10-05 Thread Peter Waller
anyway. - Peter On 5 October 2010 14:39, Peter Waller peter.wal...@cern.ch 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 object which can

Re: [sqlalchemy] Expunge

2010-09-25 Thread Peter Hansen
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 this group, send email to sqlalch...@googlegroups.com

[sqlalchemy] Re: SQLite: Rolling back DDL requests

2010-08-14 Thread Peter Hansen
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 group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send

[sqlalchemy] Re: SQLite: Rolling back DDL requests

2010-08-13 Thread Peter Hansen
()) def test03(self): '''use transaction with isolation_level None''' self.setup(connect_args={'isolation_level': None}) self.rollback_txn() self.assertEqual(['foo'], self.get_table_names()) if __name__ == '__main__': unittest.main() -- Peter Hansen

[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

[sqlalchemy] Re-using labels

2010-04-26 Thread Peter Waller
) :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 Google Groups sqlalchemy group. To post

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

2010-01-11 Thread Peter
, ... Column('enter_date', Unicode(50)) Conclusion: Be careful with dates and sqlite Peter -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com

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

2009-12-11 Thread Peter
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 mentioned. Any ideas ? Peter

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 this MetaData instance. Specify 'useexisting=True' to redefine options

[sqlalchemy] clear_mappers does not really clear

2009-12-09 Thread Peter
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 group. To post to this group, send

[sqlalchemy] clear_mappers does not really clear

2009-12-09 Thread Peter
) ? 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 group, send email to sqlalch...@googlegroups.com

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

2009-12-07 Thread Peter
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 vm...@mycircuit.org wrote: Hi Lets suppose I created an engine on database 'foo' and I want to create a database

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 vm...@mycircuit.org wrote: Thanks a lot, I guess I still have to abstract away my standard sql behavior .. Peter -- You received this message because you are subscribed to the Google

[sqlalchemy] how to change a database

2009-12-03 Thread Peter
( 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 function lambda at 0x8821bc4 ignored Thanks a lot for your advice Peter -- You

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

2009-11-23 Thread Peter
/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 subscribed to the Google Groups

[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
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 crude or unusual that might be. Thanks. :) -- Peter Hansen

[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 the delayedresult.AbortEvent() object

[sqlalchemy] Re: Cannot abort wxPython thread with SQLAlchemy

2008-06-09 Thread Peter Hansen
() 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@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED

[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 post to this group, send

[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 trouble... first it was an EGG issue, I've fixed that installing everything

[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

[sqlalchemy] KeyError: 'inet'

2007-01-16 Thread Peter Nixon
types with Python? Cheers -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc pgpjoEKtC0XSY.pgp Description: PGP signature