The problem is that the script makes some assumptions, since it is a very
simple port of analogous mysql script.
One problem with sqlite is that .schema extracts the DDL statements in the
exact form they where issued, there is not any attempt to reverse db table
to a sequence of DDL statements.  The statements are "saved" into sqlite
when the tables are created as is.  Not even attempt to pretty print.
So if you want the script to work DDL must be like this:

CREATE TABLE t1 ('p' varchar(50),
                              'q' int,...
...
                            );

mic


2013/4/19 Niphlod <[email protected]>

> it should be a problem related to regexes finding the right things in your
> database.
>
> the script starts issuing the query
>
> select name,sql from sqlite_master
> where type='table'
> and
> not name like '\_%'
> and
> not lower(name) like 'sqlite_%'
>
>
> you can start from there and see where it breaks.
>
>
> PS: you should be aware that if you field names hold special characters
> you can't use a define_table with those... e.g. a table named "my custom
> table" (spaces in it) can't be used with DAL, but it's fine for SQLite.
>
>
>
>
> On Friday, April 19, 2013 7:09:49 PM UTC+2, Alec Taylor wrote:
>>
>> Using aforementioned script I get no `Field`s in the generated DAL
>> schema; all I get are the table names.
>>
>> For example:
>>
>>     CREATE TABLE "OeTy"("OfNa" varchar(50),"FiAm" float,"Of A"
>> smallint,"OfSt" varchar(255));
>>
>> Becomes:
>>
>>     legacy_db.define_table('OeTy', migrate=False)
>>
>> How do I get this to work properly?
>>
>> Thanks for all suggestions,
>>
>> Alec Taylor
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to