Re: Is there something easier than ORM?



Thanks for your reply.

With sqlalchemy, an mapped must living in a session, you have no way
to disconnect it with its session.

For example :

#-------------------------------------
user = session.query(User).first()
session.expunge(user)
print user.name #Error here
#-------------------------------------

I just want to get an read-only copy of user disconnected with session
to avoid unexpected database operation.
But after expunge, properties of user is not accessible anymore.

BTW : why you choose elixir instead of sqlalchemy's own schema
definition style?
Doesn't including another library means more chances of bugs?

On Feb 17, 9:24 pm, "Diez B. Roggisch" <de...@xxxxxxxxxxxxx> wrote:
一首诗 schrieb:



Hi all,

Recently I am studying some python ORM libraries, such as sqlalchemy.

These are very powerful technologies to handle database.  But I think
my project are not complicated to enough to benefit from a complete
ORM system.

What I really want, is some easy ways to load data from database, and
change rows of data to list of named tuple, then I could send these
data to my client application.

I don't think I want these subtle behavior such as lazy load, auto
update, ect. in ORM.

So is there some libraries like that?

Or is there some tools that could generate code from database scheme
as I want?

Sqlalchemy. You don't need to use the ORM-layer, and you can use
reflection to create schema-objects like tables.

Then you can use that to create SQL-queries simple & powerful, whilst
being DB-agnostic and having a road to start using the ORM if you
discover it is useful for you.

To be honest: if you can control the schema, I'd still go for an orm. I
for example use elixir. It makes the easy things *really* easy, and the
complicated ones ar still possible.

Diez

.



Relevant Pages

  • Re: Is there something easier than ORM?
    ... With sqlalchemy, an mapped must living in a session, you have no way ... to disconnect it with its session. ... There is a good sqlalchemy mailing list where even the developers hang ... ORM system. ...
    (comp.lang.python)
  • Re: Mapped drives show disconnected when users log off and log on
    ... > I created roaming profile for all the users but since the wireless would ... > disconnect once in a while and they would loose their roaming profiles I ... > I have a vbs logon script which maps drives according to what groups the ... > computer they have two session starting, one is with the name of the computer ...
    (microsoft.public.windows.server.active_directory)
  • Mapped drives show disconnected when users log off and log on
    ... I created roaming profile for all the users but since the wireless would ... disconnect once in a while and they would loose their roaming profiles I ... I have a vbs logon script which maps drives according to what groups the ... computer they have two session starting, one is with the name of the computer ...
    (microsoft.public.windows.server.active_directory)
  • Re: TSE & Romaing profiles. Saving Office Autorecover info to roam
    ... to reconnect for about 10 to 15 minutes the session is disconnected. ... And sometimes they are not able to get reconnected to a disconnect session ... may be this is the recovery info, ...
    (microsoft.public.windows.terminal_services)
  • Re: Why does idle telnet session get disconnected?
    ... I think we finally found a reason for the disconnect problem ... > not for telnet sessions originating from on campus. ... > forwarded the packets over a separate circuit to the target system at his ... > It didn't see any packets from the idle telnet session for>60 minutes, ...
    (comp.os.vms)

Loading