[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-15 Thread az

they said in Soft Wars: read the source, Luke...
u want everything premade?
it's what it says. no mysql in there. i've no idea about mysql. 
just add it - poke here and there - and once it works for you, post it 
here. i'll check it in...

On Thursday 15 May 2008 07:08:59 Lukasz Szybalski wrote:
 On Fri, May 9, 2008 at 10:14 AM,  [EMAIL PROTECTED] wrote:
  On Friday 09 May 2008 16:32:25 Lukasz Szybalski wrote:
  On Fri, May 9, 2008 at 4:46 AM,  [EMAIL PROTECTED] wrote:
   On Friday 09 May 2008 03:05, Lukasz Szybalski wrote:
   Do you guys know what would give me column definition of
   table?
  
   do u want it as generated source-text or what?
 
  Yes. The Final output I would like is the txt version of db
  definitions.
 
  autoload ---  sqlalchemy.Column('Address_Sid',
  sqlalchemy.Integer, primary_key=True),
 
  well, then see that one.
 
   have a look at dbcook/dbcook/misc/metadata/autoload.py
   at dbcook.sf.net
 
  running 'python autoload.py dburl' will dump the db-metadata into
  src-text,

 I keep getting this error:

  python autoload.py mysql://user:[EMAIL PROTECTED]/mytable
 Traceback (most recent call last):
   File autoload.py, line 204, in ?
 assert 0, 'unsupported engine.dialect:'+str( engine.dialect)
 AssertionError: unsupported
 engine.dialect:sqlalchemy.databases.mysql.MySQLDialect object at
 0x2af7f6f522d0
 (ENV)[EMAIL PROTECTED]:~/tmp/metadata$ python autoload.py
 mysql://root:[EMAIL PROTECTED]/mysql
 mysql://root:[EMAIL PROTECTED]/mysql
 Traceback (most recent call last):
   File autoload.py, line 204, in ?
 assert 0, 'unsupported engine.dialect:'+str( engine.dialect)
 AssertionError: unsupported
 engine.dialect:sqlalchemy.databases.mysql.MySQLDialect object at
 0x2b11f2dcb2d0


 Any ideas?
 Lucas

 


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



[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-14 Thread Lukasz Szybalski

On Fri, May 9, 2008 at 10:14 AM,  [EMAIL PROTECTED] wrote:

 On Friday 09 May 2008 16:32:25 Lukasz Szybalski wrote:
 On Fri, May 9, 2008 at 4:46 AM,  [EMAIL PROTECTED] wrote:
  On Friday 09 May 2008 03:05, Lukasz Szybalski wrote:
  Do you guys know what would give me column definition of table?
 
  do u want it as generated source-text or what?

 Yes. The Final output I would like is the txt version of db
 definitions.

 autoload ---  sqlalchemy.Column('Address_Sid', sqlalchemy.Integer,
 primary_key=True),
 well, then see that one.

  have a look at dbcook/dbcook/misc/metadata/autoload.py
  at dbcook.sf.net

 running 'python autoload.py dburl' will dump the db-metadata into
 src-text,

I keep getting this error:

 python autoload.py mysql://user:[EMAIL PROTECTED]/mytable
Traceback (most recent call last):
  File autoload.py, line 204, in ?
assert 0, 'unsupported engine.dialect:'+str( engine.dialect)
AssertionError: unsupported
engine.dialect:sqlalchemy.databases.mysql.MySQLDialect object at
0x2af7f6f522d0
(ENV)[EMAIL PROTECTED]:~/tmp/metadata$ python autoload.py
mysql://root:[EMAIL PROTECTED]/mysql
mysql://root:[EMAIL PROTECTED]/mysql
Traceback (most recent call last):
  File autoload.py, line 204, in ?
assert 0, 'unsupported engine.dialect:'+str( engine.dialect)
AssertionError: unsupported
engine.dialect:sqlalchemy.databases.mysql.MySQLDialect object at
0x2b11f2dcb2d0


Any ideas?
Lucas

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



[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-09 Thread Lele Gaifax

On Thu, 8 May 2008 19:05:20 -0500
Lukasz Szybalski [EMAIL PROTECTED] wrote:

 Do you guys know what would give me column definition of table?

There is an autocode tool that, although with some glitches on it own,
does exactly what you are looking for.

See http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode (but
note that the current version is not the one attached to the page, but
rather lives in a repository on code.google.com).

ciao, lele.
-- 
nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia.
[EMAIL PROTECTED] | -- Fortunato Depero, 1929.

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



[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-09 Thread Lukasz Szybalski

On Fri, May 9, 2008 at 4:46 AM,  [EMAIL PROTECTED] wrote:

 On Friday 09 May 2008 03:05, Lukasz Szybalski wrote:
 Do you guys know what would give me column definition of table?
 do u want it as generated source-text or what?

Yes. The Final output I would like is the txt version of db definitions.

autoload ---  sqlalchemy.Column('Address_Sid', sqlalchemy.Integer,
primary_key=True),


 have a look at dbcook/dbcook/misc/metadata/autoload.py
 at dbcook.sf.net


 I have a table that I autoload and I would like to get this:

 address_table = sqlalchemy.Table('address', metadata,
 sqlalchemy.Column('Address_Sid', sqlalchemy.Integer, primary_key=True),
 sqlalchemy.Column('FirstName', sqlalchemy.Unicode(40),nullable=False),
 sqlalchemy.Column('LastName', sqlalchemy.Unicode(40),nullable=False),
 sqlalchemy.Column('MaidenLastName', sqlalchemy.Unicode(40)),
 sqlalchemy.Column('Email', sqlalchemy.Unicode(80),nullable=False),


 So:
 I can get a list of tables:
 for i in metadata.tables:
 ... print i

 list of columns:
  for i in metadata.tables['WMI'].original_columns:
 ... print i

 How do I get column type, indexes and primary keys?

 Lucas

 On Tue, Apr 15, 2008 at 7:44 PM, Lukasz Szybalski [EMAIL PROTECTED]
 wrote:
  Hello,
  Is there maybe a feature in sqlalchemy that would allow me to autoload
  table from one database, and move it over to another database?
 
  1. I would like to print data structure from autoload table. (then
  copy and paste it into new file  and use it to create new
  table)(without typing every data structure)
  2. And/or autoload via one engine and autoupload via different engine
  and create_all()
  3. Analyze csv files and create sqlalchemy definition like structure.
 
  Ideas?
 
  Lucas

 




-- 
Automotive Recall Database. Cars, Trucks, etc.
http://www.lucasmanual.com/recall/
TurboGears Manual-Howto
http://lucasmanual.com/pdf/TurboGears-Manual-Howto.pdf

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



[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-09 Thread az

On Friday 09 May 2008 16:32:25 Lukasz Szybalski wrote:
 On Fri, May 9, 2008 at 4:46 AM,  [EMAIL PROTECTED] wrote:
  On Friday 09 May 2008 03:05, Lukasz Szybalski wrote:
  Do you guys know what would give me column definition of table?
 
  do u want it as generated source-text or what?

 Yes. The Final output I would like is the txt version of db
 definitions.

 autoload ---  sqlalchemy.Column('Address_Sid', sqlalchemy.Integer,
 primary_key=True),
well, then see that one.

  have a look at dbcook/dbcook/misc/metadata/autoload.py
  at dbcook.sf.net

running 'python autoload.py dburl' will dump the db-metadata into 
src-text, trying to convert some types into their generic form.
see also other files in that directory, copyall.py and copydata.py, 
for copying stuff between dburls.

ciao
svil

  I have a table that I autoload and I would like to get this:
 
  address_table = sqlalchemy.Table('address', metadata,
  sqlalchemy.Column('Address_Sid', sqlalchemy.Integer,
  primary_key=True), sqlalchemy.Column('FirstName',
  sqlalchemy.Unicode(40),nullable=False),
  sqlalchemy.Column('LastName',
  sqlalchemy.Unicode(40),nullable=False),
  sqlalchemy.Column('MaidenLastName', sqlalchemy.Unicode(40)),
  sqlalchemy.Column('Email',
  sqlalchemy.Unicode(80),nullable=False),
 
 
  So:
  I can get a list of tables:
  for i in metadata.tables:
  ... print i
 
  list of columns:
   for i in metadata.tables['WMI'].original_columns:
  ... print i
 
  How do I get column type, indexes and primary keys?
 
  Lucas
 
  On Tue, Apr 15, 2008 at 7:44 PM, Lukasz Szybalski
  [EMAIL PROTECTED]
 
  wrote:
   Hello,
   Is there maybe a feature in sqlalchemy that would allow me to
   autoload table from one database, and move it over to another
   database?
  
   1. I would like to print data structure from autoload table.
   (then copy and paste it into new file  and use it to create
   new table)(without typing every data structure)
   2. And/or autoload via one engine and autoupload via different
   engine and create_all()
   3. Analyze csv files and create sqlalchemy definition like
   structure.
  
   Ideas?
  
   Lucas



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