The first question you might answer is:  how would you do this without
web2py?  What are your steps?

Then, you can ask - how does web2py get into this, and what web2py
facilities (if any) do something like this?

A few observations:

If you 'create' a web2py table definition for an existing table, you
only need to define the fields you will be accessing.
This should be a good way to make a test table definition, with just
one field,  so that you can test if a table already exists
(set migrate=False in your test table definition - see
http://web2py.com/book/default/section/6/4 for more info).

... anything you could not (or would not want to) do simply in web2py
API calls, you can write sql and "send" it from web2py.
That means your first "exercise" of "how would I do this without
web2py" can become directly useful.

Some other sections that might be helpful:
http://web2py.com/book/default/section/6/7
http://web2py.com/book/default/section/6/4?search=executesql

- Yarko


On Jun 15, 3:30 am, mika <miss.from.h...@gmail.com> wrote:
> so what I can do if I have database already created? I would like
> simply to connect db and see if tables exists...
> by the way, metadata used by web2py to recognize tables created by
> itself is working only on sqlite, or on other db also?
>
> On Jun 11, 3:46 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
>
>
> > if you set migrate=True web2py does the check for you and eventually
> > creates tables. It can only detect tables if they were created by
> > web2py itself since it uses metadata for that purpose.

Reply via email to