It uses information_schema (ANSI Standard), so it might support others
databases too.
It connects to live databases (doesn't need SQL dump), and supports:
keyed tables, most data types, default values, constraints (unique/not
null/referential fk) and comments.
Best regards,
Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com
On Mon, Oct 4, 2010 at 1:30 AM, Álvaro Justen [Turicas]
<alvaro...@gmail.com> wrote:
> On Sun, Oct 3, 2010 at 19:37, Alexandre Andrade
> <alexand...@gmail.com> wrote:
>> Alvaro,
>>
>> I didn't see this post before.
>>
>> this can be a great feature and I will trye to adapt it to postgresql and
>> mysql, at least.
>>
>> if massimo already don't use it, with sqlite, postresql and mysql, it can
>> worth the value.
>
> Please post news about this. :-)
>
> --
> Álvaro Justen - @turicas
> http://blog.justen.eng.br/
> 21 9898-0141
>
Field('journal_id', type='reference journal'),
about which web2py complains.
I suppose I have to clean that up by hand.
Regards
Johann
--
May grace and peace be yours in abundance through the full knowledge
of God and of Jesus our Lord! His divine power has given us
everything we need for life and godliness through the full knowledge
of the one who called us by his own glory and excellence.
2 Pet. 1:2b,3a
def query(conn, sql,*args):
"Execute a SQL query and return rows as a list of dicts"
cur = conn.cursor()
ret = []
try:
if DEBUG: print >> sys.stderr, "QUERY: ", sql % args
cur.execute(sql, args)
for row in cur:
dic = {}
for i, value in enumerate(row):
field = cur.description[i][0]
dic[field] = value
if DEBUG: print >> sys.stderr, "RET: ", dic
ret.append(dic)
cur.close () ??
return ret
finally:
cur.close()
cur.close is at finally clause (it always gets executed)
Yes, there are some known issues now:
* you have to order table definitions correctly to prevent references
to undefined tables
* you cannot mix normal tables (with id field) and keyed tables (with
primarykey)
Regards,