[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-10-07 Thread ron_m
I have it working here and worked on it to improve the dictionary. It needs more work in the id field area because they are converted to an integer, also boolean fields which get represented as char(1) would become string. My testing has been to take the database produced by my model files and run

Re: [web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-10-07 Thread Ivan Matveev
>2010/10/7 DJ : > The legacy database to Web2py conversion would be a great add-on. I > get the following errors when I tried this script on a database with > tables having primary key 'id' set to autoincrement. > > C:\Program Files (x86)\web2py\scripts>extract_mysql_models.py > bio:b...@nrcf > Tra

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-10-06 Thread DJ
The legacy database to Web2py conversion would be a great add-on. I get the following errors when I tried this script on a database with tables having primary key 'id' set to autoincrement. C:\Program Files (x86)\web2py\scripts>extract_mysql_models.py bio:b...@nrcf Traceback (most recent call last

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-17 Thread ron_m
Program mysqldump produces a line like this for an id field `id` int(11) NOT NULL AUTO_INCREMENT, and because there is no special case processing int becomes integer. It looks like a possible solution would be to recognise AUTO_INCREMENT and for that case over ride the int translation to 'inte

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-17 Thread mdipierro
I see a problem here: Field('id','integer'), should be Field('id','id'), On Sep 9, 12:01 am, ron_m wrote: > On Sep 8, 1:30 pm, mdipierro wrote: > > > > So maybe tonight do you want me to go through the manual and find all > > > the missing datatypes and try to add them to the map? > >

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-17 Thread ron_m
The size of the data in the database shouldn't matter, it runs mysql to get the table list and then mysqldump on each table using the first output. This script needs some testing but the only way to test is pass more databases through it. It works well on my particular DB but yours has a new case

Re: [web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-16 Thread Johann Spies
How do I use this script? I gave a fairly complex and relatively large database (few hunderd thousand records) to try and use with web2py. When I run this script (the version that came with 1.85.2) I get: $ python extract_mysql_models.py user:pas...@kbase Traceback (most recent call last): Fi

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-10 Thread selecta
then GPL2 is fine with me On Sep 10, 4:19 pm, mdipierro wrote: > If the license is GPL3 I will not include it web2py. Can you make it > GPL2 or BSD? > > GPL3 conflicts with GPL2 becuase would not allow the use of the code > as a service and that is what web2py is about. > > Massimo > > On Sep 10,

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-10 Thread mdipierro
If the license is GPL3 I will not include it web2py. Can you make it GPL2 or BSD? GPL3 conflicts with GPL2 becuase would not allow the use of the code as a service and that is what web2py is about. Massimo On Sep 10, 8:11 am, selecta wrote: > > I turned this into a script in web2py/scripts in t

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-10 Thread selecta
wow I am impressed with the work you put into that little script that was just a byproduct for moving my legacy mysqldb to web2py :) thank you On Sep 9, 7:01 am, ron_m wrote: > On Sep 8, 1:30 pm, mdipierro wrote: > > > > So maybe tonight do you want me to go through the manual and find all > > >

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-10 Thread selecta
> I turned this into a script in web2py/scripts in trunk. What is the > license? I assume it is GPL or BSD but it should be stated. nice license is GPL3 or above ... actually I just use GPL all the time because I do not have a lawyer here to tell me the differences between the licences :) it should

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 1:30 pm, mdipierro wrote: > > So maybe tonight do you want me to go through the manual and find all > > the missing datatypes and try to add them to the map? > > I would not stop you. ;-) > Here is a replacement data_type_map, it was shuffled a bit to put like types together for easie

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread mdipierro
> So maybe tonight do you want me to go through the manual and find all > the missing datatypes and try to add them to the map? I would not stop you. ;-) > There are > possibly some types that are not supported by web2py so not sure what > to do there. The other possible problem I see is fields

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 11:56 am, mdipierro wrote: > I think I fixed these. One more try? > I did a temporary add of the key "longtext," to get it to run further and found a key error mediumtext which also is at end of line with a comma so the regular expression parsing the line pulls out "mediumtext," as th

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 11:56 am, mdipierro wrote: > I think I fixed these. One more try? > > On Sep 8, 10:30 am, ron_m wrote: I think the re match still has a problem but it is closer. The fault is on a key error for "longtext," which should not be trying to match on the field type including the comma. Th

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread mdipierro
I think I fixed these. One more try? On Sep 8, 10:30 am, ron_m wrote: > On Sep 8, 5:40 am, mdipierro wrote: > > > I think I fixed some of this in trunk. Could you print form me the > > line offending hit? If i see it I can fix the regular expression too. > > Thanks. > > I ran the new version fro

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 8, 5:40 am, mdipierro wrote: > I think I fixed some of this in trunk. Could you print form me the > line offending hit? If i see it I can fix the regular expression too. > Thanks. > I ran the new version from trunk. The if hit!=None: line added at line 74 covers up the problem so now I ge

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread mdipierro
I think I fixed some of this in trunk. Could you print form me the line offending hit? If i see it I can fix the regular expression too. Thanks. On Sep 8, 3:03 am, ron_m wrote: > On Sep 7, 5:10 pm, mdipierro wrote: > > > If you have a mysql database running locally, please help me test it. > > F

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-08 Thread ron_m
On Sep 7, 5:10 pm, mdipierro wrote: > If you have a mysql database running locally, please help me test it. > First problem I ran into Last line parameters are out of order on mysql() call so it outputs incorrect database URL string $ python scripts/extract_mysql_models.py user:p...@db_name use

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-07 Thread mdipierro
If you have a mysql database running locally, please help me test it. python script/extract_mysql_models.py username:passw...@database_name > applications/myapp/models/db_from_mysql.py Check applications/myapp/models/db_from_mysql.py. Did it work? On Sep 7, 5:47 pm, mdipierro wrote: > I turned

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-09-07 Thread mdipierro
I turned this into a script in web2py/scripts in trunk. What is the license? I assume it is GPL or BSD but it should be stated. Massimo On Aug 26, 5:36 pm, selecta wrote: > Create the web2py code needed to access yourmysqllegacydb. > > To make this work all thelegacytables you want to access nee

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-08-27 Thread mr.freeze
Nice! On Aug 26, 5:36 pm, selecta wrote: > Create the web2py code needed to access your mysql legacy db. > > To make this work all the legacy tables you want to access need to > have an "id" field. > > This plugin needs: > mysql > mysqldump > installed and globally available. > > Under Windows yo

[web2py] Re: plugin legacy mysql: generates web2py code to access your mysql legacy db

2010-08-27 Thread Dalen Kruse
Excellent! I was just coming up on a personal project that requires me to use a legacy database. I wasn't looking forward to writing the models myself. Thanks for this plugin. Dalen On Aug 26, 5:36 pm, selecta wrote: > Create the web2py code needed to access your mysql legacy db. > > To make