I don't know about the syntax. I'm trying to decide which Framework I
should go with. I have one database that has information about personal
details. Another database has information about various purchases, still
another database has information about other family members. This is an
example, but there are this many databases I have to use with information
that is related.
I have to create a webpage that goes out and gets all that information and
puts in a single webpage, so the user doesn't have to go to six pages to
see all the data.
I do not need to create any tables. I only need to do the retrieval.
In Django I read something about getting inspectdb to create the objects
via their ORM.
Is that the same way in web2py? Can I write just regular SQL? How does it
work?
On Thursday, March 20, 2014 3:55:36 PM UTC-4, 黄祥 wrote:
>
> hm, pardon me, not sure what do you want to achieve. is it something like
> this?
> e.g.
> ## Use SQLite
> db0 = DAL('sqlite://testmultipledb.sqlite')
>
> ## Use MySQL
> db1 = DAL('mysql://root:@localhost/testmultipledb')
>
> ## Use PostgreSQL
> db2 = DAL('postgres://postgres:a@localhost/testmultipledb')
>
> db0.define_table('person', Field('name'), format='%(name)s')
> db1.define_table('person', Field('name'), format='%(name)s')
> db2.define_table('person', Field('name'), format='%(name)s')
>
> db0.person.insert(name="Alex")
> db1.person.insert(name="BAlex")
> db2.person.insert(name="CAlex")
>
> row0 = db0().select(db0.person.ALL).first()
> row1 = db1().select(db1.person.ALL).first()
> row2 = db2().select(db2.person.ALL).first()
>
> best regards,
> stifan
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.