Re: [sqlalchemy] How to query an optional column on a self referential adjacency list table?

2016-10-16 Thread Jinghui Niu
Do I need to turn on or do some configuration with SQLAlchemy before using CTE? Like foreign keys On Sun, Oct 16, 2016 at 10:41 AM, Mike Bayer wrote: > > oh I was wrong, SQLite has it: > > https://www.sqlite.org/lang_with.html > > > that leaves just MySQL out. > > On

Re: [sqlalchemy] How to query an optional column on a self referential adjacency list table?

2016-10-16 Thread Mike Bayer
oh I was wrong, SQLite has it: https://www.sqlite.org/lang_with.html that leaves just MySQL out. On 10/16/2016 01:21 PM, Jinghui Niu wrote: Thanks Mike. On Sun, Oct 16, 2016 at 7:14 AM, Mike Bayer > wrote: On 10/14/2016

Re: [sqlalchemy] How to query an optional column on a self referential adjacency list table?

2016-10-16 Thread Jinghui Niu
Thanks Mike. On Sun, Oct 16, 2016 at 7:14 AM, Mike Bayer wrote: > > > On 10/14/2016 06:08 PM, Jinghui Niu wrote: > >> I have the following Table model representing a timeline. >> >> | >> classTimeRange(Base): >> >> >> __tablename__ ="time_line" >> >> >>

Re: [sqlalchemy] How to query an optional column on a self referential adjacency list table?

2016-10-16 Thread Mike Bayer
On 10/14/2016 06:08 PM, Jinghui Niu wrote: I have the following Table model representing a timeline. | classTimeRange(Base): __tablename__ ="time_line" record_id =Column(Integer,primary_key=True) level =Column(String,nullable=False)# e.g. "Point", "Range" content

Re: [sqlalchemy] Sequence schema

2016-10-16 Thread Mike Bayer
On 10/14/2016 11:44 AM, Seth P wrote: I have a mixin of the following form class MyMixin(object): idx = sa.Column(sa.Integer, sa.Sequence('idx_seq', schema=???, optional=True), primary_key=True) ... I would like the sequence to have the same schema as the table into which MyMixin