hmm OK, I guess that work around would do it. > I supposed in the longer run, we could add the equivalent code to the DAL > specifically for sqlite.... perhaps that is the best longer term option. +1
I am tied to sqlite because the site is live and users are editing right now. But maybe it will be practical to migrate over night. I had a try just now with db.export_to_csv_file() / db.import_from_csv_file() and after fixing some reserved keywords and NULL references, managed to import. Yarko, I read you migrated the live Pycon database, so do you have any tips? Richard On Aug 13, 10:55 am, Yarko Tymciurak <[email protected]> wrote: > if you're tied to sqlite, then why don't you use the conversion tools to > take the SQL for the table creation (you can find it in your app/databases > files when the tables were created) to set up the sqlite triggers to do the > equivalent; then you can add that to an execsql call to setup once (ideally > at table creation - you can do it manually on your development system). > > Anyway, that's the way I think - I would not have my app / higher level > replicate what the data system will do - even if the data server in question > doesn't do it in a standard way. > > I supposed in the longer run, we could add the equivalent code to the DAL > specifically for sqlite.... perhaps that is the best longer term option. > > On Wed, Aug 12, 2009 at 6:52 PM, Richard <[email protected]> wrote: > > > unfortunately upgrading sqlite is not an option in my situation. And > > we are locked into sqlite at the moment. > > > So I'm going to need to solve this through the DAL. Is there a single > > query that could delete all my A's and B's? Or do I > > need to iterate through the A's and remove them all manually? > > > Richard > > > On Aug 13, 5:47 am, Yarko Tymciurak <[email protected]> wrote: > > > If you must use sqlite, then google for sqlite cascade - there are C > > program > > > files that will convert your SQL to sqlite triggers which will accomplish > > > this (according to all that I saw - I have no experience); there is even > > a > > > website where you can paste your table definition, and it will generate > > the > > > equivalent sql for sqlite for you. > > > > I think it would be just as easy / easier to install postgres (or > > something > > > of your choice) and use that. Of course, if you are writing something to > > > run on a mobile device, you may not have any choice; for pretty much > > > everything else, you have choices... > > > > On Wed, Aug 12, 2009 at 2:13 PM, Richard <[email protected]> wrote: > > > > > hmm, that's a pity. Thanks for the link. > > > > Is there a single query that could delete all my A's and B's? Or do I > > > > need to iterate through the A's and remove them all manually? > > > > > Richard > > > > > On Aug 12, 5:52 pm, Yarko Tymciurak <[email protected]> wrote: > > > > > It apprears that sqlite does not support this - seehttp:// > > > >www.sqlite.org/omitted.html > > > > > > On Wed, Aug 12, 2009 at 2:41 AM, Richard <[email protected]> > > wrote: > > > > > > > hello, > > > > > > > Does sqlite support cascade or am I doing something wrong? > > > > > > > I have these tables: > > > > > > db.define_table('A', > > > > > > db.Field('B', db.B, ondelete='CASCADE'), > > > > > > ) > > > > > > db.define_table('B', > > > > > > db.Field('name'), > > > > > > ) > > > > > > > And when I run db(db.A.id > 0).delete(), the B's are still there. > > > > > > > Richard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

