[sqlalchemy] Re: Having SA generate constructor when using autoload.

2016-08-24 Thread Piotr Dobrogost
> On Monday, August 22, 2016 at 11:12:11 AM UTC+2, Piotr Dobrogost wrote: > > (...) > Is there a way to hold off this check until after I map this class like this > > my_table = sa.Table("my_table", meta.metadata, autoload=True, autoload_with=engine) &g

Re: [sqlalchemy] Having SA generate constructor when using autoload.

2016-08-23 Thread Piotr Dobrogost
On Monday, August 22, 2016 at 12:54:27 PM UTC+2, Simon King wrote: > > > You'd probably be best off copying the SQLAlchemy code into your own > project - it's not long: > > >

[sqlalchemy] Having SA generate constructor when using autoload.

2016-08-22 Thread Piotr Dobrogost
I'd like to map a class onto table and automatically get __init__() method per http://docs.sqlalchemy.org/en/rel_1_0/orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.declarative_base.params.constructor However when I declare class as Base = declarative_base(metadata=metadata)

Re: [sqlalchemy] How to generate a file with DDL in the engine's SQL dialect? How to copy engine?

2016-05-11 Thread Piotr Dobrogost
On Wednesday, May 11, 2016 at 12:37:15 PM UTC+2, Simon King wrote: > > > Ah, ok. The problem is that the "sql" parameter in your executor > function has not yet been compiled for the dialect in use. Try this > Thanks Simon, this works (SA 1.0.12) although according to the answer in SA 0.9+

Re: [sqlalchemy] How to generate a file with DDL in the engine's SQL dialect? How to copy engine?

2016-05-11 Thread Piotr Dobrogost
> On Wednesday, May 11, 2016 at 11:03:57 AM UTC+2, Simon King wrote: >> On Wed, May 11, 2016 at 9:39 AM, Piotr Dobrogost >> >> What's the reason for these differences? > > At least for the quoting issue, it sounds like you aren't using the > Oracle dialect. What d

Re: [sqlalchemy] How to generate a file with DDL in the engine's SQL dialect? How to copy engine?

2016-05-11 Thread Piotr Dobrogost
On Monday, May 9, 2016 at 5:05:11 PM UTC+2, Mike Bayer wrote: > > > the only thing that is sigificant with "mock" is the first part of the > URL. You can just send the whole URL though, so just like this: > > mock_engine = create_engine(real_engine.url, strategy="mock", ...) > I see

Re: [sqlalchemy] How to generate a file with DDL in the engine's SQL dialect? How to copy engine?

2016-05-11 Thread Piotr Dobrogost
On Tuesday, May 10, 2016 at 2:55:44 PM UTC+2, Simon King wrote: > > > Could you use Alembic's offline mode? > > http://alembic.readthedocs.io/en/latest/offline.html > Thanks. Will try. Regards, Piotr -- You received this message because you are subscribed to the Google Groups "sqlalchemy"

Re: [sqlalchemy] How to generate a file with DDL in the engine's SQL dialect? How to copy engine?

2016-05-10 Thread Piotr Dobrogost
On Monday, May 9, 2016 at 5:05:11 PM UTC+2, Mike Bayer wrote: > > > the only thing that is sigificant with "mock" is the first part of the > URL. You can just send the whole URL though, so just like this: > > mock_engine = create_engine(real_engine.url, strategy="mock", ...) > Thanks Mike.

[sqlalchemy] How to generate a file with DDL in the engine's SQL dialect? How to copy engine?

2016-05-09 Thread Piotr Dobrogost
engine as a template on which the new engine would be based upon. Is there any way to do such a copy and modification? Is the answer above still the best way to get DDL resulting from calling create_all()? Best regards, Piotr Dobrogost -- You received this message because you are subscribed

Re: [sqlalchemy] Bug in BufferedColumnResultProxy class?

2016-04-28 Thread Piotr Dobrogost
ort is exemplar. Best regards from users of your excellent SQLAlchemy, Marcin Raczyński i Piotr Dobrogost from Poland ps. The original investigation of the issue and suggested fix was done by Marcin Raczyński. -- You received this message because you are subscribed to the Google Groups "sqlalc

Re: [sqlalchemy] Bug in BufferedColumnResultProxy class?

2016-04-26 Thread Piotr Dobrogost
On Tue, Apr 26, 2016 at 12:18 AM, Mike Bayer <mike...@zzzcomputing.com> wrote: > > On 04/25/2016 11:04 AM, Piotr Dobrogost wrote: >> >> Is caching using dogpile what you call "Query cache extension"? If so >> we don't use it. > > this extensio

Re: [sqlalchemy] Declaring column NOT NULL only for specific dialect (Oracle)?

2016-04-26 Thread Piotr Dobrogost
and does not bring me closer to knowing how to manipulate DDL for column creation in general. Regards, Piotr Dobrogost -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails fr

Re: [sqlalchemy] Declaring column NOT NULL only for specific dialect (Oracle)?

2016-04-26 Thread Piotr Dobrogost
On Fri, Apr 22, 2016 at 5:57 PM, Mike Bayer <mike...@zzzcomputing.com> wrote: > > On 04/22/2016 11:51 AM, Piotr Dobrogost wrote: >> >> >Column('some_col', nullable=False, info={"oracle_not_null": False}) >> > >> >then in your @comp

Re: [sqlalchemy] Bug in BufferedColumnResultProxy class?

2016-04-25 Thread Piotr Dobrogost
lback being logged: 2016-04-25 16:36:02,975 INFO [sqlalchemy.engine.base.Engine][waitress] ROLLBACK however I don't know if it answers your last question. > any of these true for your case ? Looks like you haven't provided a stack > trace for your issue, I'm sure you have that, so se

Re: [sqlalchemy] Bug in BufferedColumnResultProxy class?

2016-04-25 Thread Piotr Dobrogost
On Friday, April 22, 2016 at 5:22:38 PM UTC+2, Mike Bayer wrote: > > > On 04/22/2016 10:40 AM, Piotr Dobrogost wrote: > > It seems BufferedColumnResultProxy class (used only in Oracle dialect) > > has a bug. > > I cannot confirm it, would need a test case. Here

[sqlalchemy] Making column not nullable for specific dialect (Oracle)

2016-04-23 Thread Piotr Dobrogost
Hi! Unfortunately it's impossible to insert empty string in not null column in Oracle (http://stackoverflow.com/q/203493/95735). That's why I would like to declare specific column as nullable only for Oracle dialect. How to do this? Regards, Piotr Dobrogost -- You received this message

[sqlalchemy] Bug in BufferedColumnResultProxy class?

2016-04-22 Thread Piotr Dobrogost
problem. I'm going to raise issue on tracker as soon as someone confirms this bug. Best regards, Piotr Dobrogost -- 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

[sqlalchemy] Declaring column NOT NULL only for specific dialect (Oracle)?

2016-04-22 Thread Piotr Dobrogost
As Oracle does not support inserting empty string into NOT NULL column I would like to declare specific column as nullable only for Oracle. How can I do this? Regards, Piotr Dobrogost -- You received this message because you are subscribed to the Google Groups "sqlalchemy&q

Re: [sqlalchemy] Accessing name of the table in class' attributes.

2016-04-21 Thread Piotr Dobrogost
) File "/home/piotr/.virtualenvs/kotti/lib/python2.7/site-packages/sqlalchemy/orm/relationships.py", line 1682, in for x in File "/home/piotr/.virtualenvs/kotti/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 3820, in _only_column_elements &q

[sqlalchemy] Accessing name of the table in class' attributes.

2016-04-20 Thread Piotr Dobrogost
declaration of "id" column? Regards, Piotr Dobrogost -- 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. T

[sqlalchemy] Posting SQLAlchemy-Continnum related posts to this group?

2016-04-18 Thread Piotr Dobrogost
Hi! Is it allowed to post questions regarding SQLAlchemy-Continuum's extension to SQLAlchemy to this group? I raised related issue at https://github.com/kvesteri/sqlalchemy-continuum/issues/138 Regards, Piotr Dobrogost -- You received this message because you are subscribed to the Google

[sqlalchemy] Re: Feedback on "Basic Relationship Patterns" docs

2016-04-13 Thread Piotr Dobrogost
Many To Many: Countries and Languages and this makes very nice example. Regards, Piotr Dobrogost -- 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

Re: [sqlalchemy] Support for Oracle 12c auto increment (IDENTITY) columns?

2016-04-13 Thread Piotr Dobrogost
le sequence for such column? Is there some recipe solving this problem? Regards, Piotr Dobrogost -- 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 s

[sqlalchemy] Support for Oracle 12c auto increment (IDENTITY) columns?

2016-04-13 Thread Piotr Dobrogost
es)? If so, do I have to enable this somehow? Regards, Piotr Dobrogost -- 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...@googl

Re: [sqlalchemy] OperationalError with SQLite with simple update query

2016-03-19 Thread Piotr Dobrogost
On Wednesday, March 16, 2016 at 4:41:38 PM UTC+1, Simon King wrote: > > > Hmm, ok. In that case, does it work if you use "TextValue.id.in_(ids)" > rather than Node? I can't tell from your > Yes, this works – see my last post in this thread. > description if the "id" and "value" columns are

Re: [sqlalchemy] OperationalError with SQLite with simple update query

2016-03-19 Thread Piotr Dobrogost
On Wednesday, March 16, 2016 at 3:51:16 PM UTC+1, Simon King wrote: > > On Wed, Mar 16, 2016 at 1:43 PM, Piotr Dobrogost < > p...@2016.groups.google.dobrogost.net > wrote: > >> Hi! >> >> When executing below code >> >> DBSession.quer

[sqlalchemy] OperationalError with SQLite with simple update query

2016-03-19 Thread Piotr Dobrogost
rror [SQL: u'UPDATE text_values SET value=? FROM nodes WHERE nodes.id IN (?, ?, ?, ?)'] [parameters: (u'zzz', u'1685', u'175', u'1688', u'180')] Does SA construct query which is not valid in SQLite? How can I solve this problem? Regards, Piotr Dobrogost -- You received this message b

Re: [sqlalchemy] Re: Can I make bulk update through association proxy?

2016-03-18 Thread Piotr Dobrogost
On Saturday, February 27, 2016 at 10:26:53 PM UTC+1, Mike Bayer wrote: > > > If I can just wrap this up, do i understand correctly that this would > the functionality of "joined eager loading", except applied to something > like an UPDATE..FROM ? > I think so although I can't say I'm 100% sure

Re: [sqlalchemy] Re: Can I make bulk update through association proxy?

2016-02-27 Thread Piotr Dobrogost
On Friday, February 26, 2016 at 7:45:46 PM UTC+1, Jonathan Vanasco wrote: I'm not either, and I'm scared of the SQL that would be generated and the > wire traffic/memory if there were. That would be subselects within > subqueryloads within... this also seems a bit more about "updates to >

Re: [sqlalchemy] Re: Can I make bulk update through association proxy?

2016-02-26 Thread Piotr Dobrogost
On Thursday, February 25, 2016 at 2:33:13 PM UTC+1, Simon King wrote: Maybe I'm not understanding your question properly. The return value from > query.all() is a plain python list. You're asking for it to return a > different kind of object, that wraps the underlying list and allows you to >

Re: [sqlalchemy] Re: Can I make bulk update through association proxy?

2016-02-25 Thread Piotr Dobrogost
On Thursday, February 25, 2016 at 11:10:36 AM UTC+1, Simon King wrote > > > I can't think of a way you could do this with objects you've already > loaded into memory. Perhaps you could use Query.update to issue the > appropriate SQL directly to the database? > > >

[sqlalchemy] Re: Can I make bulk update through association proxy?

2016-02-25 Thread Piotr Dobrogost
On Wednesday, February 24, 2016 at 2:41:43 PM UTC+1, Piotr Dobrogost wrote: > > Hi! > > Let's say I have a model Text with attribute "values" which is association > proxy. > I can update single object like this: > text = session.query(Text).one() > text.value

Re: [sqlalchemy] Dependency rule tried to blank-out primary key column when trying to update using association proxy

2016-02-24 Thread Piotr Dobrogost
On Wednesday, February 24, 2016 at 4:07:07 PM UTC+1, Mike Bayer wrote: > > > There might be an old issue in bitbucket that the way associationproxy > insists on calling clear() without any hook to override, the AP has a > lot of old override hooks that are complicated and difficult to use, and

Re: [sqlalchemy] Dependency rule tried to blank-out primary key column when trying to update using association proxy

2016-02-24 Thread Piotr Dobrogost
On Wednesday, February 24, 2016 at 4:21:58 AM UTC+1, Mike Bayer wrote: in that way you can control exactly what __set__() does and it will > never remove a TextValue object where the same identity is coming in on > assignment. > One more question; is this described somewhere in the docs? I

[sqlalchemy] Can I make bulk update through association proxy?

2016-02-24 Thread Piotr Dobrogost
ery? texts = session.query(Text).all() texts???values???.update(...) Regards, Piotr Dobrogost -- 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

Re: [sqlalchemy] Dependency rule tried to blank-out primary key column when trying to update using association proxy

2016-02-24 Thread Piotr Dobrogost
On Wednesday, February 24, 2016 at 4:21:58 AM UTC+1, Mike Bayer wrote: in that way you can control exactly what __set__() does and it will > never remove a TextValue object where the same identity is coming in on > assignment. > Mike, thank you very much for your help. Regards, Piotr --

[sqlalchemy] Dependency rule tried to blank-out primary key column when trying to update using association proxy

2016-02-23 Thread Piotr Dobrogost
() text.values = {'pl': u'modified', 'en': u'modified'} session.commit() Working example is at https://gist.github.com/piotr-dobrogost/74073cf11006fb68e555 What am I doing wrong? Best regards, Piotr Dobrogost -- You received this message because you are subscribed to the Google Groups "sqlal

[sqlalchemy] Question about FAQ entry titled "I’m getting a warning or error about “Implicitly combining column X under attribute Y”"

2015-09-08 Thread Piotr Dobrogost
Hi! In the FAQ there's entry titled "I’m getting a warning or error about “Implicitly combining column X under attribute Y”" with the following example: class A(Base): __tablename__ = 'a' id = Column(Integer, primary_key=True) class B(A): __tablename__ = 'b' # probably not

Re: [sqlalchemy] Question about FAQ entry titled "I’m getting a warning or error about “Implicitly combining column X under attribute Y”"

2015-09-08 Thread Piotr Dobrogost
On Tuesday, September 8, 2015 at 1:37:05 PM UTC+2, Richard Kuesters wrote: | is your "A" class abstract and/or are you using them with polymorphism? Thank you for taking time to look at this. If by abstract you mean abstract as defined at

Re: [sqlalchemy] Question about FAQ entry titled "I’m getting a warning or error about “Implicitly combining column X under attribute Y”"

2015-09-08 Thread Piotr Dobrogost
On Tuesday, September 8, 2015 at 4:36:38 PM UTC+2, Richard Kuesters wrote: > > well, i'm sorry if i'm pouring could water on you but continuum never > worked as expected (at least for me) and i always used > Cold shower it is indeed :( Nevertheless thank you for your time and interest. I keep

[sqlalchemy] Re: [SQLAlchemy-Continuum] sqlalchemy.exc.InvalidRequestError: Implicitly combining column(...) in joined table inheritance scenario

2015-09-07 Thread Piotr Dobrogost
On Sunday, September 6, 2015 at 11:02:36 PM UTC+2, Piotr Dobrogost wrote: > > Hi! > > I've recently raised a bug on SQLAlchemy-Continuum's tracker at > https://github.com/kvesteri/sqlalchemy-continuum/issues/105 > As I've got no replies on SQLAlchemy-Continuum

[sqlalchemy] [SQLAlchemy-Continuum] sqlalchemy.exc.InvalidRequestError: Implicitly combining column(...) in joined table inheritance scenario

2015-09-06 Thread Piotr Dobrogost
e activity on this project lately I thought I would post here hoping someone knows this extension and could shed some light on what might be the reason for the error. In the issue there's small test case and traceback. Thank you in advance. Regards, Piotr Dobrogost -- You received this message b

Re: [sqlalchemy] SQLAlchemy-Continnum over 300 failed tests

2015-09-03 Thread Piotr Dobrogost
On Thursday, September 3, 2015 at 3:58:42 PM UTC+2, Michael Bayer wrote: > > > well, I don't even know what SQLAlchemy-Continuum is.Is their > bugtracker open on github? > You must have forgotten then :) – https://groups.google.com/d/msg/sqlalchemy/BGWLUjaFtpY/ubLshcvHlKUJ They have bug

[sqlalchemy] SQLAlchemy-Continnum over 300 failed tests

2015-09-03 Thread Piotr Dobrogost
is at https://gist.github.com/piotr-dobrogost/4140267dc9dd654f5560 Regards, Piotr Dobrogost -- 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 sqlalchem