Results 1 to 3 of 3

Thread: Implementation help (database application)

  1. #1
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation Implementation help (database application)

    Hi,
    I have some doubts about the future development of my application; now it is essentially a database application which shows informations of a magazine's issues (articles, stories, authors, etc). All the data are stored in a sqlite file and the program queries it. Periodically I release new version of this file that the program downloads and installs. With the next main version I'd like to let the user add annotations, rate articles, etc. and, perhaps, build a sort of social network. But these personal informations must be stored somewhere; it can't be the file above since il will be replaced by new versions; I can't use a second database file because it isn't possible at the same time query two databases. Perhaps I should rethink the entire data structure, but this is a new field for me and I do not know what would be the best way. So here I am asking your suggestions on this matter or pointing me to a similar project.

    Very thanks
    Giuseppe CalÃ

  2. #2
    Join Date
    Dec 2009
    Location
    Brisbane
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Implementation help (database application)

    http://www.sqlite.org/lang_attach.html

    The above should help. Rather than replacing the database, have a set of tables that are the core information. either, use them attached, or attach your update database, get rid of the old info, and replace it from the new database.

    so, for example, if you attach the database as "updates", you can then "insert into infotable select * from updates.infotable"

    Hope this helps.

  3. The following user says thank you to tangential for this useful post:

    jiveaxe (5th February 2010)

  4. #3
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Implementation help (database application)

    Very thanks tangential,
    your solution is great and simple; I've tried it in the console for now, but it should work with qt. Only an updates to your query:

    insert or replace into infotable select * from updates.infotable

    This for avoid the unique primary key error.

    Regards
    Giuseppe CalÃ

Similar Threads

  1. Replies: 3
    Last Post: 9th February 2011, 20:30
  2. Replies: 10
    Last Post: 22nd July 2009, 23:52
  3. Replies: 2
    Last Post: 17th April 2009, 22:36
  4. Run database application from Konqueror
    By jiveaxe in forum Newbie
    Replies: 3
    Last Post: 17th October 2007, 17:54
  5. My application can't connect to database when deploy it???
    By gtthang in forum Installation and Deployment
    Replies: 1
    Last Post: 15th February 2006, 11:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.