Thank you for the advices.

I just come across an interesting database software kexi (www.kexi-
project.org), there one can store the designs, queries and scripts
into the database. And the database is in itself SQLite only, which
does not support complicated database user-defined functions. So that
basically all the information needed to retrieve all the function of
the database is just in one file (as it is SQLite based), which is
quite portable. Does anyone know how they achieved this?

Rick Morrison wrote:
> I guess you know that storing the actual bytecodes (or the source) of a
> Python function in the database itself is not going to buy you much:
>
> Since the function bytecodes or source
> would be in Python, only a Python interpreter could run it to produce
> the function result, and if you know you're going to be accessing
> the database via a Python interpreter (most likely via SA), then you may as
> well just bundle the function in a module, import it and use it there like
> the rest of us do.
>
> If your'e searching for some more "portable" database logic that can be run
> from both a Python interpreter and other types of tools, you want database
> user-defined functions (UDF)s and stored procedures. SA supports several
> database that sport one or both of these tools:
>
> Oracle             both
> SQL Server      both
> Mysql              both
> Postgresql       functions only, but can modify data like stored procedures
>
> All of these will run the UDF or the stored procedure in the process of the
> database server, not in the context of your Python program. That means you
> won't be able to access variables in your Python program from the UDF or
> procedure, you'll need to supply them as parameters.
>
> If you really have to have the function be a Python function, the PLPython
> language for Postgresql allows you to run a real Python interpreter in the
> context of the server itself. There was a guy named James Pye who was
> working on a full-blown Python programming environment for Postgresql in
> which Python would be a full stored procedure language and could share
> variables with SQL and lots of other interesting stuff. Might be worth
> checking into -- check PGforge or Postgres contrib.
>
> Good luck with this,
>
> Rick


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

Reply via email to