Simon,

Simon Pamies wrote:
> Hi,
>
> although I said I would start on Friday if there are no objections, I
> couldn't longer resist to revamp autocode and so I moved it to google
> code.
>
> Please have a look at http://code.google.com/p/sqlautocode/ for the
> changes and the current structure.
>
> I also removed some contents from 
> http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode
> to reflect the move.
>
> I performed a release under LGPL. Hope that this is ok and fits into
> the sqlalchemy environment.
>
> If s/o has objections and/or wants to add information/data/code feel
> free to contact me.
>
> Simon Pamies
>   
I had changed one of the other versions to handle Firebird and got it to 
work for my purposes, but did some hacks which were not for public 
consumption.

If you or someone else can help me working the hacks out then maybe 
Firebird could be supported by this new autocode.

I did the test with sqlalchemy 0.4beta6, which seems to require some 
changes to autocode.

Traceback 1:
Traceback (most recent call last):
  File "autocode.py", line 140, in <module>
    c.type = autoloader.coltypes[ c.type.__class__ ]()
KeyError: <class 'sqlalchemy.types.Integer'>

I don't know how to fix the above.

Traceback 2:
Traceback (most recent call last):
  File "autocode.py", line 61, in <module>
    dburl = engine.url.make_url(url)
NameError: name 'engine' is not defined

Just commenting the line "dburl = engine.url.make_url(url)" is fine as 
the "dburl" is not used.

Traceback 3:
Traceback (most recent call last):
  File "autocode.py", line 71, in <module>
    metadata = BoundMetaData(db)
NameError: name 'BoundMetaData' is not defined

Just change:
    metadata = BoundMetaData(db)
to:
    metadata = MetaData(db)

Traceback 4:
Traceback (most recent call last):
  File "formatter.py", line 75, in <module>
    sql._TextClause.__repr__ = textclause_repr
NameError: name 'sql' is not defined

I don't know how to correct this, but as FB doesn't use schema I did get 
around it by just commenting the block "Monkey patching sqlalchemy repr 
functions"

Question for FB:
What should be returned to the variable "sqltext" for indexes in the 
following code?

for name,tbl_name,sqltext in db.execute( me.sql4indexes):

The output for a table then looks like this:

I18N_CURRLANG                                                                   
              
= 
Table('I18N_CURRLANG                                                            
                    
', 
MetaData(Engine(firebird://SYSDBA:[EMAIL 
PROTECTED]/c:/dev/twcb/data/i18n.fdb)), 
Column(u'id', Integer(), primary_key=True, nullable=False), 
Column(u'user_name', String(length=80,convert_unicode=False)), 
Column(u'lang', String(length=20,convert_unicode=False), 
nullable=False), schema=None)

It would be nice to add maybe a "pretty print" option so it would look 
more like this:

I18N_CURRLANG  = Table('I18N_CURRLANG',
              
MetaData(Engine(firebird://USER:[EMAIL PROTECTED]/c:/dev/twcb/data/i18n.fdb)),
              Column(u'id', Integer(), primary_key=True, nullable=False),
              Column(u'user_name', 
String(length=80,convert_unicode=False)),
              Column(u'lang', String(length=20,convert_unicode=False), 
nullable=False), schema=None)

Another option would be nice to replace:
              
MetaData(Engine(firebird://USER:[EMAIL PROTECTED]/c:/dev/twcb/data/i18n.fdb)),

with just:
              metadata

I.e. just the variable for metadata, so that one can assign an engine at 
run time.

Another thing is the table names, but I believe this is an FB issue, 
they should be .strip()'ed and I also do a .lower() on them, so they 
look nicer (in my tests this does not cause any problems).

When these things are worked out I'll send you the little bit of code 
need in loader.py for FB.

Best regards
Werner

--~--~---------~--~----~------------~-------~--~----~
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