Hi guys! Here goes the code sample:
from sqlalchemy import create_engine, MetaData
from sqlalchemy import Table, Column, ForeignKey, Integer
from sqlalchemy.orm import sessionmaker, mapper, relation
metadata = MetaData()
engine = create_engine('sqlite:///:memory:', echo=True)
parent_table =
On Mar 3, 1:03 am, Michael Bayer mike...@zzzcomputing.com wrote:
its a bug, there's an isinstance(str) that should be
isinstance(basestring). please file a trac ticket.
Done, here it is:
http://www.sqlalchemy.org/trac/ticket/1330
--
Karlo Lozovina
I'm using SA with SQLite, and after executing session.close() and
clear_mappers(), on Linux, lsof still says my SQLite file is open.
Running engine.dispose() seems to finally close it, but I'm not sure
if that's the proper way?
Thanks,
Karlo.
--~--~-~--~~~---~--~~
On May 6, 10:53 pm, jason kirtland [EMAIL PROTECTED] wrote:
That's correct. The engine holds the connection pool and dispose() will
close the connections it manages.
Thanks... it's weird there's no mention of it in the docs.
--
Karlo Lozovina - Mosor
Let's say I have two classes A and B, and I want instances of both
classes, to have a list of each other, that is, many-to-many
relationship. For a shorthand, a means instance of A, and b is an
instance of B.
For example: a.bs is a list, full of instances of class B.
Similarly, b.as is a list,
On May 4, 10:40 pm, Barry Hart [EMAIL PROTECTED] wrote:
By chance, in your mappers, are you declaring two relationships instead of
one relation with a
backref?
Yep, that was it, thanks! Should have read the docs more carefully ;).
As a side note, once you straighten this out, you may want
Hi guys, sorry for the vague subject, here is my problem. Let's say I
have the following table:
a = Table('aaa', meta,
Column('id', Integer, primary_key=True),
Column('id2', Integer))
class A(object):
pass
mapper(A, a)
I want the default value of A.id2 to be that of a A.id. So, for
Hi all,
browsing the SQLAlchemy docs I coudn't find any references to a
particular SQLite feature, ON CONFLICT clause (http://www.sqlite.org/
lang_conflict.html), is there any support for this in SA? What I want
to do is this, create my database as such:
CREATE TABLE songs(
id INTEGER
Greetings everyone,
does SQLAlchemy somehow support SQLites' ATTACH DATABASE statement? I
have a in-memory SQLite database that I want to dump to file, so I was
thinking of using ATTACH to do it. Any other ideas welcome ;).
Thanks in advance,
Karlo.
On Mar 9, 4:33 pm, Michael Bayer [EMAIL PROTECTED] wrote:
attach database ...wow i never knew it had that ! if its a matter of
issuing the string attach database, just use literal text() or
engine.execute().
Me neither ;), until the other day I started looking for an efficient
way to dump
10 matches
Mail list logo