[sqlalchemy] What's the difference between the two syntax of declaring index?

2020-07-17 Thread Bob Fang
id = sa.Column(sa.Integer, *primary_key=True*) field_1 = sa.Column(sa.Integer) __table_args__ = (*sa.Index("field_1_index", "field_1")*) Here we are mixing method 1 and 2. From my experiment it seems Postgres can accept this without any problem but Sqlite rejects it outrigh

Re: [sqlalchemy] Bizzarre insert behavior: NULL constraint violation with non-null value, column changes every run.

2015-07-28 Thread Bob Ternosky
nasco, your suggestions didn't work, but I learned a few new settings. On Tuesday, July 28, 2015 at 11:54:14 AM UTC-4, Michael Bayer wrote: > > Just curious, can you try out cx_Oracle 5.1.3? I've seen some problems > reported with Py3K and cx_Oracle 5.2. > > On 7/

[sqlalchemy] Re: Bizzarre insert behavior: NULL constraint violation with non-null value, column changes every run.

2015-07-28 Thread Bob Ternosky
d: ['batch_id', 'batch_type', 'scheduled_date', 'status', 'emp_id', 'bill_per', 'label', 'log_file', 'debug_file', 'completed_date'] Additionally, the insert still failed the exact same way. On Tuesd

[sqlalchemy] Re: Bizzarre insert behavior: NULL constraint violation with non-null value, column changes every run.

2015-07-28 Thread Bob Ternosky
I had not tested that parameter. But adding case_sensitive to my "create_engine" call with either "=True" or ="False" made no difference. On Tuesday, July 28, 2015 at 11:51:00 AM UTC-4, Jonathan Vanasco wrote: > > Have you tried toggling the sqlalchemy connection string? > > > http://docs.sqlalc

[sqlalchemy] Re: Bizzarre insert behavior: NULL constraint violation with non-null value, column changes every run.

2015-07-28 Thread Bob Ternosky
Yes. In fact if I take the output parameterized SQL + values and combine them together and run vs SQL*Plus the insert works. Using this: 2015-07-28 11:12:40,844 INFO sqlalchemy.engine.base.Engine b'INSERT INTO corp.test_table (batch_id, batch_type, scheduled_date, status, emp_id, bill_per, lab

[sqlalchemy] Bizzarre insert behavior: NULL constraint violation with non-null value, column changes every run.

2015-07-28 Thread Bob Ternosky
I'm new to SQLAlchemy and have been playing with it for a week. I've got many SELECT based pieces working and exercising properly, but have hit a huge wall when trying to test inserts. Worse, what's happening makes no sense at all. This will hopefully contain the full set of information needed.

[sqlalchemy] Re: execute() and commit() and "commit"

2010-02-12 Thread Bob Farrell
"commit" as text for sqlite). Thanks, On Feb 12, 12:33 pm, Bob Farrell wrote: > Sorry, I forgot to mention that if I run my "select * from test;" > *after* I get the error for test3, it shows that insert did in fact > get committed to the database: > > {<

[sqlalchemy] Re: execute() and commit() and "commit"

2010-02-12 Thread Bob Farrell
quot;commit" is getting sent to the database and it's processing correctly, but SQLAlchemy is stepping in somewhere on the way back before the execute() returns and causing some mischief. On Feb 12, 12:19 pm, Bob Farrell wrote: > Hi there, > > I'm having a bit of trouble wi

[sqlalchemy] execute() and commit() and "commit"

2010-02-12 Thread Bob Farrell
see explosions. This is for a SQL repl I wrote some time ago and I decided to add transactions to it so I need a sane way to deal with "commit" being typed. I'd like to make this behaviour optional so that it can mimic other sql repls such as sqlplus. Any suggestions on the best

[sqlalchemy] Re: Changes in exc.py causing problems.

2009-05-27 Thread Bob Farrell
Hooray. \o/ I'll leave the code commented until I pull the next release. Cheers, On May 26, 6:03 pm, "Michael Bayer" wrote: > this is all fixed in the current trunk.  release probably today as the > issue you have below is more severe than the one I had noticed.

[sqlalchemy] Changes in exc.py causing problems.

2009-05-26 Thread Bob Farrell
repr(self.statement), > repr(self.params[:2]), > '... and a total of %i bound parameters' % > len(self.params))) This change is resulting in this problem: File "/home/bob/src/prospectspace/branches/sqlalchemy-eon-merge/ prospectspace/c

[sqlalchemy] Re: Possible bug in orm/state.py

2009-05-26 Thread Bob Farrell
On May 26, 3:31 pm, "Michael Bayer" wrote: > Bob Farrell wrote: > > > Hi Michael, I found this (your writing) in a thread from quite a while > > back: > > >> A common pattern which can cause what you see there is if your > >> templates are a

[sqlalchemy] Re: Possible bug in orm/state.py

2009-05-26 Thread Bob Farrell
have gone out of scope. Thanks for any advice you can offer. On May 26, 9:33 am, Bob Farrell wrote: > On May 23, 7:56 pm, Michael Bayer wrote: > > > On May 23, 2009, at 1:47 PM, Bob Farrell wrote: > > > > Hi, using scoped_session(sessionmaker()) to create my sessions, if

[sqlalchemy] Re: Possible bug in orm/state.py

2009-05-26 Thread Bob Farrell
On May 23, 7:56 pm, Michael Bayer wrote: > On May 23, 2009, at 1:47 PM, Bob Farrell wrote: > > > > > Hi, using scoped_session(sessionmaker()) to create my sessions, if I > > hammer a > > request (using Pylons) by repeatedly clicking on a link that uses the > &

[sqlalchemy] Possible bug in orm/state.py

2009-05-23 Thread Bob Farrell
es an AttributeError here +pass return ATTR_WAS_SET @property Here's the original traceback before the change: File '/home/bob/src/prospectspace/branches/sqlalchemy-eon-merge/ prospectspace/controllers/company.py', line 206 in index return self.render_re

[sqlalchemy] Re: Extended Query subclass with add_named_column method

2009-03-31 Thread Bob Farrell
relation on the mapper ? If there's a way to do this in SQLAlchemy that doesn't need extra mapper config then I'm all ears. :-) On Mar 31, 3:22 pm, Michael Bayer wrote: > wouldn't this be accomplished more simply using contains_eager() ? > > On Mar 31, 2009,

[sqlalchemy] Extended Query subclass with add_named_column method

2009-03-31 Thread Bob Farrell
Hello, SQLAlchemy people, So I spoke to jek on IRC to see if there was a way to use add_column without causing the query to return a RowTuple and it doesn't look like there is, so I wrote this: class AdditiveQuery(Query): """ Extended sqlalchemy.orm.Query class with add_named_column meth

[sqlalchemy] Re: Textual SQL

2009-02-02 Thread Bob Farrell
tely? > Using text() creates a ClauseElement that you can whack together with other constructs. See the docs here for more info: http://www.sqlalchemy.org/docs/05/sqlexpression.html#using-text > Thanks! > > -- -- Bob Farrell pH, an Experian Company

[sqlalchemy] Postgres and count() weirdness

2009-01-29 Thread Bob Farrell
ems worth pointing out in case you weren't aware of it. Thanks. :-) -- -- Bob Farrell pH, an Experian Company www.phgroup.com Office Line: 020 7598 0310 Fax: 020 7598 0311 -- --~--~-~--~~~---~--~~ You received t

[sqlalchemy] Re: New instance ExtraStat with identity key (...) conflicts with persistent instance ExtraStat

2008-12-02 Thread Bob
I keep thinking one of my relatives has emailed me when you post here and I get all excited. Any chance you can change your name ? :-) 2008/12/2 Doug Farrell <[EMAIL PROTECTED]>: > Michael, > > > > Thanks for the pointer, that makes great sense, and once again points how my > generally small data

[sqlalchemy] Re: Orphans not deleted using cascade parameter

2008-08-28 Thread Bob Farrell
On Wed, Aug 27, 2008 at 12:53:38PM -0700, Alex Mathieu wrote: > > Thanks Michael, I'll have a look over this !! > > Bob, thanks also for your help, however, I'm not able to use the > code... maybe the indention is wrong here or I don't know... I was > able to

[sqlalchemy] Re: Orphans not deleted using cascade parameter

2008-08-27 Thread Bob Farrell
if x.primary_key] cond = pk[0] == pk_cols[0] for x, y in zip(pk[1:], pk_cols[1:]): if x and y: cond &= x == y yield delete( obj_table, cond ) --

[sqlalchemy] Cascading delete

2008-08-21 Thread Bob Farrell
ys have done a really good job. If you think there's room for something like this in SA then it's all yours. :-) Cheers, -- -- Bob Farrell pH, an Experian Company www.phgroup.com Office Line: 020 7598 0310 Fax: 020 7598 0311 -- --~--~---

[sqlalchemy] Re: Question regarding an adjacency-tree example in svn repo

2007-11-13 Thread bob
Thanks for clearing that up! :) Bob --~--~-~--~~~---~--~~ 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,

[sqlalchemy] Question regarding an adjacency-tree example in svn repo

2007-11-13 Thread bob
the table definition, and then shorter aliases in the mapper. (eg. parent_node_id, parent_id, ...) I couldn't really figure out whether this is necessary functional-wise. It would be nice if I could just use shorter column names to begin with and skip the extra aliases. Any thoughts on tha