-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi gaetan,

it took me time, but in the end we were talking about the same thing, and you
made the terms clearer to me. elixir is using an orm to map tables to and
perform certain object operations, like query, new record of class derived from
entity etc.

i just don't know, but i should probably ask on sa list or better search the
doc, whether all table operations may be hooked like before_insert of versioning
(for tables mapped to mapperextensions), or only mapper extensions knows about
the table it maps to.

such a hook would possibly allow non orm mapped table operations on the entity,
however enjoing that "trigger".

thanks,
alex

Gaetan de Menten wrote:
| On Thu, Jul 3, 2008 at 11:23 AM, alex bodnaru <[EMAIL PROTECTED]> wrote:
|> -----BEGIN PGP SIGNED MESSAGE-----
|> Hash: SHA1
|>
|>
|>
|> Gaetan de Menten wrote:
|> | On Fri, Jun 27, 2008 at 6:29 PM, alex bodnaru <[EMAIL PROTECTED]> wrote:
|> |
|> |> please let me know, whether any part of the registered actions in elixir
|> |> (through extensions api) are activated at the sa level, or only when
|> |> manipulating the data through elixir.
|> |
|> | I'm not sure I understand the question... All Elixir's extensions (I
|> | guess you mean the "statements" system or maybe the "builder" stuff)
|> | are only taken care of by Elixir code. I mean that if you use
|> | something like "using_options(xxx=yyy)" on an raw SA mapped class, it
|> | will be simply ignored.
|> | But, of course, all those extensions, when processed by Elixir end up
|> | calling SA code.
|> |
|> for example, the versioning extension is setting version = 1 at insert time.
|> but i found the answer, and it's no: an insert statement at sa level wouldn't
|> set version==1 :(
|
| To be clear, that would work through sa's "orm" part (see below).
|
|> |> secondly, could i set a record filter through an extension? again, would 
it be
|> |> possible to activate it at sa level (and-ed with the where filter in 
select
|> |> statements)?
|> |
|> | Sorry, but this time I really don't understand the question... Through
|> | an extension, you can modify the generated mapper and table objects in
|> | any way you like. If "setting a record filter" (whatever that is)
|> | falls within those limits, then yes you can.
|> |
|> i was thinking at a record filter based on some logic. but it will anyway 
work
|> at elixir level only.
|>
|> | You might be interested in the following page:
|> | http://elixir.ematia.de/trac/wiki/BehindTheScene
|> |
|>
|> so my conclusion would be to insert/update (think versioning) at the elixir
|> level only, while selects may be used freely at sa level too.
|>
|> what remains to be checked, whether the sa guys would allow reistering
|> before_insert/update actions, then it would be nice to hook the elixir based
|> extensions deeper in the sa orm.
|
| I think you are confusing the two levels of abstraction SQLAlchemy
| provides and Elixir. Or maybe this was all already clear to you and I
| didn't understand what you meant...
|
| For the record: SA provides an SQL toolkit, which is just a way to
| express SQL constructs in a pythonic way:
|
|>>> s = select([users, addresses], users.c.id==addresses.c.user_id)
| sql>>> for row in conn.execute(s):
| ...     print row
|
| SQLAlchemy also provide an ORM, which maps python objects with table rows.
|
| Elixir is *not* another ORM on top of SA. It only provides a different
| syntax to uses the ORM provided by SQLAlchemy.
|
| The before_insert extensions are no exception, they are exposing in a
| simple way a feature from the ORM SQLAlchemy provides (namely
| MapperExtensions).
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSGzF+tpwN1sq38njAQIvjQP/SN+6YiXUCGjZSM5kv6aRy0pQLB8M0lDm
EA+bNi7Au8DN0cKRDTz7aR0yu7r/HgErEifeXve+Uk7P2pljgEs7IK4Uj6gi9jKC
G9gCZbF/hWGuXgeBBqkk7SzFFuVcwknjd/Nae6m9Jsx4qOeQe+wAaSM/lI2UoYdy
+qqZPQk5AMw=
=iU8X
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to