← Back to team overview

ubuntu-touch-coreapps team mailing list archive

Re: [RSS Reader] SQL operation code

 

Joey, looks great, but it is necessary to carefully consider all of this
operations!

P.S.
While Lisette talked I forgot to ask my question - what with work items in
our blueprint?
I can't finish my without design guides.
So, we must focus on database development while designers have no even
alpha version?


2013/5/10 Joey Chan <qqworini@xxxxxxxxx>

> Hi Ladies and Gentlemen,
>
> I have completed some SQL operation code for database, note that they are
> not perfect because I'm a bit busy this week, any comments or suggestion
> are welcome.
>
>
>
> 1. feed operation
>
> 1.1 add feed
> // id = null, link = null, description = null, pubdate = null, image =
> null, count = null
>
> insert into feed values (
>   id ,
>  source ,
>  title ,
>  link ,
>  description ,
>  pubdate ,
>  image,
>  count )
>
> 1.2 modify feed
> update feed set title = ?, source = ? where id = ?       // end-users can
> only modify these two values
>
> update feed set link = ?, description = ?, pubdate = ? where id = ?
>  // these values automaticly update by feed source
>
> update feed set image = ? where id = ?     // image path, for offline use
>
> update feed set count = ? where id = ?     // a number which how many
> times user views this feed
>
> 1.3 delete feed
> delete from feed where id = ?
>
>
> 2. article operation
>
> 2.1 add article
> //  most of the values come from feed xml files
>
> insert into article values (
>  id ,
>  title ,
>  link ,
>  description ,
>  pubdate ,
>  status ,
>  favourite ,
>  image ,
>  guid ,
>  feed_id  )
>
> 2.2 modify article
> update article set status = ? where id = ?              // 0 for unread, 1
> for read, 2 for read later
>
> update article set favourite = ? where id = ?            // 0 for not, 1
> for favourite
>
> update article set image = ? where id = ?              // image path, for
> offline use
>
> 2.3 delete article
> delete from article where id = ?
>
>
> 3. tag operation
>
> 3.1 add tag
> insert into tag values (
>  id,
>  name )
>
> 3.2 modify tag
> update tag set name = ? where id = ?
>
> 3.3 delete tag
> delete from tag where id = ?
>
>
> 4. feed_tag operation
>
> 4.1 add feed_tag
> insert into feed_tag values (
>  id ,
>  feed_id ,
>  tag_id )
>
> 4.2 modify feed_tag
> (no need)
>
> 4.3 delete feed_tag
> delete from feed_tag where id = ?
>
> 5. settings operation
> // only one row is needed to save all settings, values will be initial
> after create table
>
> 5.1 modify settings
> update settings set current_database_version = ? where id = 1
> update settings set database_last_updated = ? where id = 1
> update settings set view_mode = ? where id = 1
> update settings set update_interval = ? where id = 1
> update settings set network_mode = ? where id = 1
>
> 6. operation for testing
>
> 6.1 clear table
> delete from ?         // ? is table name
>
> 6.2 drop table
> drop table if exists ?
>
>
>
> Cheers,
> Joey
>
> --
> Mailing list: https://launchpad.net/~ubuntu-touch-coreapps
> Post to     : ubuntu-touch-coreapps@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References