Classes | Namespaces | Macros | Variables
sqlitestorage.h File Reference

This file is part of the API for handling calendar data and defines the SqliteStorage class. More...

#include "mkcal_export.h"
#include "extendedstorage.h"
#include <sqlite3.h>
Include dependency graph for sqlitestorage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mKCal::SqliteStorage
 This class provides a calendar storage as an sqlite database. More...
 

Namespaces

 mKCal
 

Macros

#define sqlite3_exec(db)
 
#define sqlite3_prepare_v2(db, query, qsize, stmt, tail)
 
#define sqlite3_bind_text(stmt, index, value, size, desc)
 
#define sqlite3_bind_blob(stmt, index, value, size, desc)
 
#define sqlite3_bind_int(stmt, index, value)
 
#define sqlite3_bind_int64(stmt, index, value)
 
#define sqlite3_bind_double(stmt, index, value)
 
#define sqlite3_step(stmt)
 
#define CREATE_VERSION    "CREATE TABLE IF NOT EXISTS Version(Major INTEGER, Minor INTEGER)"
 
#define CREATE_TIMEZONES    "CREATE TABLE IF NOT EXISTS Timezones(TzId INTEGER PRIMARY KEY, ICalData TEXT)"
 
#define CREATE_CALENDARS    "CREATE TABLE IF NOT EXISTS Calendars(CalendarId TEXT PRIMARY KEY, Name TEXT, Description TEXT, Color INTEGER, Flags INTEGER, syncDate INTEGER, pluginName TEXT, account TEXT, attachmentSize INTEGER, modifiedDate INTEGER, sharedWith TEXT, syncProfile TEXT, createdDate INTEGER, extra1 STRING, extra2 STRING)"
 
#define CREATE_COMPONENTS    "CREATE TABLE IF NOT EXISTS Components(ComponentId INTEGER PRIMARY KEY AUTOINCREMENT, Notebook TEXT, Type TEXT, Summary TEXT, Category TEXT, DateStart INTEGER, DateStartLocal INTEGER, StartTimeZone TEXT, HasDueDate INTEGER, DateEndDue INTEGER, DateEndDueLocal INTEGER, EndDueTimeZone TEXT, Duration INTEGER, Classification INTEGER, Location TEXT, Description TEXT, Status INTEGER, GeoLatitude REAL, GeoLongitude REAL, Priority INTEGER, Resources TEXT, DateCreated INTEGER, DateStamp INTEGER, DateLastModified INTEGER, Sequence INTEGER, Comments TEXT, Attachments TEXT, Contact TEXT, InvitationStatus INTEGER, RecurId INTEGER, RecurIdLocal INTEGER, RecurIdTimeZone TEXT, RelatedTo TEXT, URL TEXT, UID TEXT, Transparency INTEGER, LocalOnly INTEGER, Percent INTEGER, DateCompleted INTEGER, DateCompletedLocal INTEGER, CompletedTimeZone TEXT, DateDeleted INTEGER, extra1 STRING, extra2 STRING, extra3 INTEGER)"
 
#define CREATE_RDATES    "CREATE TABLE IF NOT EXISTS Rdates(ComponentId INTEGER, Type INTEGER, Date INTEGER, DateLocal INTEGER, TimeZone TEXT)"
 
#define CREATE_CUSTOMPROPERTIES    "CREATE TABLE IF NOT EXISTS Customproperties(ComponentId INTEGER, Name TEXT, Value TEXT, Parameters TEXT)"
 
#define CREATE_RECURSIVE    "CREATE TABLE IF NOT EXISTS Recursive(ComponentId INTEGER, RuleType INTEGER, Frequency INTEGER, Until INTEGER, UntilLocal INTEGER, untilTimeZone TEXT, Count INTEGER, Interval INTEGER, BySecond TEXT, ByMinute TEXT, ByHour TEXT, ByDay TEXT, ByDayPos Text, ByMonthDay TEXT, ByYearDay TEXT, ByWeekNum TEXT, ByMonth TEXT, BySetPos TEXT, WeekStart INTEGER)"
 
#define CREATE_ALARM    "CREATE TABLE IF NOT EXISTS Alarm(ComponentId INTEGER, Action INTEGER, Repeat INTEGER, Duration INTEGER, Offset INTEGER, Relation TEXT, DateTrigger INTEGER, DateTriggerLocal INTEGER, triggerTimeZone TEXT, Description TEXT, Attachment TEXT, Summary TEXT, Address TEXT, CustomProperties TEXT, isEnabled INTEGER)"
 
#define CREATE_ATTENDEE   "CREATE TABLE IF NOT EXISTS Attendee(ComponentId INTEGER, Email TEXT, Name TEXT, IsOrganizer INTEGER, Role INTEGER, PartStat INTEGER, Rsvp INTEGER, DelegatedTo TEXT, DelegatedFrom TEXT)"
 
#define CREATE_ATTACHMENTS   "CREATE TABLE IF NOT EXISTS Attachments(ComponentId INTEGER, Data BLOB, Uri TEXT, MimeType TEXT, ShowInLine INTEGER, Label TEXT, Local INTEGER)"
 
#define CREATE_CALENDARPROPERTIES    "CREATE TABLE IF NOT EXISTS Calendarproperties(CalendarId REFERENCES Calendars(CalendarId) ON DELETE CASCADE, Name TEXT NOT NULL, Value TEXT, UNIQUE (CalendarId, Name))"
 
#define INDEX_CALENDAR   "CREATE INDEX IF NOT EXISTS IDX_CALENDAR on Calendars(CalendarId)"
 
#define INDEX_INVITATION   "CREATE INDEX IF NOT EXISTS IDX_INVITATION on Invitations(InvitationId)"
 
#define INDEX_COMPONENT   "CREATE INDEX IF NOT EXISTS IDX_COMPONENT on Components(ComponentId, Notebook, DateStart, DateEndDue, DateDeleted)"
 
#define INDEX_COMPONENT_UID   "CREATE UNIQUE INDEX IF NOT EXISTS IDX_COMPONENT_UID on Components(UID, RecurId, DateDeleted)"
 
#define INDEX_COMPONENT_NOTEBOOK   "CREATE INDEX IF NOT EXISTS IDX_COMPONENT_NOTEBOOK on Components(Notebook)"
 
#define INDEX_RDATES   "CREATE INDEX IF NOT EXISTS IDX_RDATES on Rdates(ComponentId)"
 
#define INDEX_CUSTOMPROPERTIES   "CREATE INDEX IF NOT EXISTS IDX_CUSTOMPROPERTIES on Customproperties(ComponentId)"
 
#define INDEX_RECURSIVE   "CREATE INDEX IF NOT EXISTS IDX_RECURSIVE on Recursive(ComponentId)"
 
#define INDEX_ALARM   "CREATE INDEX IF NOT EXISTS IDX_ALARM on Alarm(ComponentId)"
 
#define INDEX_ATTENDEE   "CREATE UNIQUE INDEX IF NOT EXISTS IDX_ATTENDEE on Attendee(ComponentId, Email)"
 
#define INDEX_ATTACHMENTS   "CREATE INDEX IF NOT EXISTS IDX_ATTACHMENTS on Attachments(ComponentId)"
 
#define INDEX_CALENDARPROPERTIES   "CREATE INDEX IF NOT EXISTS IDX_CALENDARPROPERTIES on Calendarproperties(CalendarId)"
 
#define INSERT_VERSION   "insert into Version values (?, ?)"
 
#define INSERT_TIMEZONES   "insert into Timezones values (1, '')"
 
#define INSERT_CALENDARS   "insert into Calendars values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '', '')"
 
#define INSERT_INVITATIONS   "insert into Invitations values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
 
#define INSERT_COMPONENTS   "insert into Components values (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, '', 0)"
 
#define INSERT_CUSTOMPROPERTIES   "insert into Customproperties values (?, ?, ?, ?)"
 
#define INSERT_CALENDARPROPERTIES   "insert into Calendarproperties values (?, ?, ?)"
 
#define INSERT_RDATES   "insert into Rdates values (?, ?, ?, ?, ?)"
 
#define INSERT_RECURSIVE   "insert into Recursive values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
 
#define INSERT_ALARM   "insert into Alarm values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
 
#define INSERT_ATTENDEE   "insert into Attendee values (?, ?, ?, ?, ?, ?, ?, ?, ?)"
 
#define INSERT_ATTACHMENTS   "insert into Attachments values (?, ?, ?, ?, ?, ?, ?)"
 
#define UPDATE_TIMEZONES   "update Timezones set ICalData=? where TzId=1"
 
#define UPDATE_CALENDARS   "update Calendars set Name=?, Description=?, Color=?, Flags=?, syncDate=?, pluginName=?, account=?, attachmentSize=?, modifiedDate=?, sharedWith=?, syncProfile=?, createdDate=? where CalendarId=?"
 
#define UPDATE_COMPONENTS   "update Components set Notebook=?, Type=?, Summary=?, Category=?, DateStart=?, DateStartLocal=?, StartTimeZone=?, HasDueDate=?, DateEndDue=?, DateEndDueLocal=?, EndDueTimeZone=?, Duration=?, Classification=?, Location=?, Description=?, Status=?, GeoLatitude=?, GeoLongitude=?, Priority=?, Resources=?, DateCreated=?, DateStamp=?, DateLastModified=?, Sequence=?, Comments=?, Attachments=?, Contact=?, InvitationStatus=?, RecurId=?, RecurIdLocal=?, RecurIdTimeZone=?, RelatedTo=?, URL=?, UID=?, Transparency=?, LocalOnly=?, Percent=?, DateCompleted=?, DateCompletedLocal=?, CompletedTimeZone=?, extra1=? where ComponentId=?"
 
#define UPDATE_COMPONENTS_AS_DELETED   "update Components set DateDeleted=? where ComponentId=?"
 
#define DELETE_TIMEZONES   "delete from Timezones where TzId=1"
 
#define DELETE_CALENDARS   "delete from Calendars where CalendarId=?"
 
#define DELETE_INVITATIONS   "delete from Invitations where InvitationId=?"
 
#define DELETE_COMPONENTS   "delete from Components where ComponentId=?"
 
#define DELETE_RDATES   "delete from Rdates where ComponentId=?"
 
#define DELETE_CUSTOMPROPERTIES   "delete from Customproperties where ComponentId=?"
 
#define DELETE_CALENDARPROPERTIES   "delete from Calendarproperties where CalendarId=?"
 
#define DELETE_RECURSIVE   "delete from Recursive where ComponentId=?"
 
#define DELETE_ALARM   "delete from Alarm where ComponentId=?"
 
#define DELETE_ATTENDEE   "delete from Attendee where ComponentId=?"
 
#define DELETE_ATTACHMENTS   "delete from Attachments where ComponentId=?"
 
#define SELECT_VERSION   "select * from Version"
 
#define SELECT_TIMEZONES   "select * from Timezones where TzId=1"
 
#define SELECT_CALENDARS_ALL   "select * from Calendars order by Name"
 
#define SELECT_INVITATIONS_ALL   "select * from Invitations"
 
#define SELECT_COMPONENTS_ALL   "select * from Components where DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_NOTEBOOK   "select * from Components where Notebook=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_ALL_DELETED   "select * from Components where DateDeleted<>0"
 
#define SELECT_COMPONENTS_ALL_DELETED_BY_NOTEBOOK   "select * from Components where Notebook=? and DateDeleted<>0"
 
#define SELECT_COMPONENTS_BY_GEO   "select * from Components where GeoLatitude!=255.0 and GeoLongitude!=255.0 and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_GEO_AREA   "select * from Components where GeoLatitude>=? and GeoLongitude>=? and GeoLatitude<=? and GeoLongitude<=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_JOURNAL   "select * from Components where Type='Journal' and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_JOURNAL_DATE   "select * from Components where Type='Journal' and DateDeleted=0 and datestart<=? order by DateStart desc, DateCreated desc"
 
#define SELECT_COMPONENTS_BY_PLAIN   "select * from Components where DateStart=0 and DateEndDue=0 and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_RECURSIVE   "select * from components where ((ComponentId in (select DISTINCT ComponentId from recursive)) or (RecurId!=0)) and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_ATTENDEE   "select * from components where ComponentId in (select DISTINCT ComponentId from attendee) and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_DATE_BOTH   "select * from Components where DateStart<=? and (DateEndDue>=? or DateEndDue=0) and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_DATE_START   "select * from Components where DateEndDue>=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_DATE_END   "select * from Components where DateStart<=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_UID_AND_RECURID   "select * from Components where UID=? and RecurId=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_UID   "select * from Components where UID=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_NOTEBOOKUID   "select * from Components where Notebook=? and DateDeleted=0"
 
#define SELECT_ROWID_FROM_COMPONENTS_BY_UID_AND_RECURID   "select ComponentId from Components where UID=? and RecurId=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_UNCOMPLETED_TODOS   "select * from Components where Type='Todo' and DateCompleted=0 and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_COMPLETED_TODOS_AND_DATE   "select * from Components where Type='Todo' and DateCompleted<>0 and DateEndDue<>0 and DateEndDue<=? and DateDeleted=0 order by DateEndDue desc, DateCreated desc"
 
#define SELECT_COMPONENTS_BY_COMPLETED_TODOS_AND_CREATED   "select * from Components where Type='Todo' and DateCompleted<>0 and DateEndDue=0 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"
 
#define SELECT_COMPONENTS_BY_DATE_SMART   "select * from Components where DateEndDue<>0 and DateEndDue<=? and DateDeleted=0 order by DateEndDue desc, DateCreated desc"
 
#define FUTURE_DATE_SMART_FIELD   " (case type when 'Todo' then DateEndDue else DateStart end) "
 
#define SELECT_COMPONENTS_BY_FUTURE_DATE_SMART
 
#define SELECT_COMPONENTS_BY_CREATED_SMART   "select * from Components where DateEndDue=0 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"
 
#define SELECT_COMPONENTS_BY_GEO_AND_DATE   "select * from Components where GeoLatitude!=255.0 and GeoLongitude!=255.0 and DateEndDue<>0 and DateEndDue<=? and DateDeleted=0 order by DateEndDue desc, DateCreated desc"
 
#define SELECT_COMPONENTS_BY_GEO_AND_CREATED   "select * from Components where GeoLatitude!=255.0 and GeoLongitude!=255.0 and DateEndDue=0 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"
 
#define SELECT_COMPONENTS_BY_INVITATION_UNREAD   "select * from Components where InvitationStatus=1 and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_INVITATION_AND_CREATED   "select * from Components where InvitationStatus>1 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"
 
#define SELECT_COMPONENTS_BY_ATTENDEE_EMAIL_AND_CREATED   "select * from Components where ComponentId in (select distinct ComponentId from Attendee where email=?) and DateCreated<=? and DateDeleted=0 order by DateCreated desc"
 
#define SELECT_COMPONENTS_BY_ATTENDEE_AND_CREATED   "select * from Components where ComponentId in (select distinct ComponentId from Attendee) and DateCreated<=? and DateDeleted=0 order by DateCreated desc"
 
#define SELECT_RDATES_BY_ID   "select * from Rdates where ComponentId=?"
 
#define SELECT_CUSTOMPROPERTIES_BY_ID   "select * from Customproperties where ComponentId=?"
 
#define SELECT_RECURSIVE_BY_ID   "select * from Recursive where ComponentId=?"
 
#define SELECT_ALARM_BY_ID   "select * from Alarm where ComponentId=?"
 
#define SELECT_ATTENDEE_BY_ID   "select * from Attendee where ComponentId=?"
 
#define SELECT_ATTACHMENTS_BY_ID   "select * from Attachments where ComponentId=?"
 
#define SELECT_CALENDARPROPERTIES_BY_ID   "select * from Calendarproperties where CalendarId=?"
 
#define SELECT_COMPONENTS_BY_DUPLICATE   "select * from Components where DateStart=? and Summary=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_DUPLICATE_AND_NOTEBOOK   "select * from Components where DateStart=? and Summary=? and Notebook=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_CREATED   "select * from Components where DateCreated>=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_CREATED_AND_NOTEBOOK   "select * from Components where DateCreated>=? and Notebook=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_LAST_MODIFIED   "select * from Components where DateLastModified>=? and DateCreated<? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_LAST_MODIFIED_AND_NOTEBOOK   "select * from Components where DateLastModified>=? and DateCreated<? and Notebook=? and DateDeleted=0"
 
#define SELECT_COMPONENTS_BY_DELETED   "select * from Components where DateDeleted>=? and DateCreated<?"
 
#define SELECT_COMPONENTS_BY_DELETED_AND_NOTEBOOK   "select * from Components where DateDeleted>=? and DateCreated<? and Notebook=?"
 
#define SELECT_COMPONENTS_BY_UID_RECID_AND_DELETED   "select ComponentId, DateDeleted from Components where UID=? and RecurId=? and DateDeleted<>0"
 
#define SELECT_ATTENDEE_AND_COUNT   "select Email, Name, count(Email) from Attendee where Email<>0 group by Email"
 
#define SELECT_EVENT_COUNT   "select count(*) from Components where Type='Event' and DateDeleted=0"
 
#define SELECT_TODO_COUNT   "select count(*) from Components where Type='Todo' and DateDeleted=0"
 
#define SELECT_JOURNAL_COUNT   "select count(*) from Components where Type='Journal' and DateDeleted=0"
 
#define BEGIN_TRANSACTION   "BEGIN IMMEDIATE;"
 
#define COMMIT_TRANSACTION   "END;"
 

Variables

const int mKCal::VersionMajor = 11
 
const int mKCal::VersionMinor = 0
 

Detailed Description

This file is part of the API for handling calendar data and defines the SqliteStorage class.

Author
Tero Aho <ext-t.nosp@m.ero..nosp@m.1.aho.nosp@m.@nok.nosp@m.ia.co.nosp@m.m>
Pertti Luukko <ext-p.nosp@m.ertt.nosp@m.i.luu.nosp@m.kko@.nosp@m.nokia.nosp@m..com>
Alvaro Manera <alvar.nosp@m.o.ma.nosp@m.nera@.nosp@m.noki.nosp@m.a.com >

Macro Definition Documentation

◆ BEGIN_TRANSACTION

#define BEGIN_TRANSACTION   "BEGIN IMMEDIATE;"

◆ COMMIT_TRANSACTION

#define COMMIT_TRANSACTION   "END;"

◆ CREATE_ALARM

#define CREATE_ALARM    "CREATE TABLE IF NOT EXISTS Alarm(ComponentId INTEGER, Action INTEGER, Repeat INTEGER, Duration INTEGER, Offset INTEGER, Relation TEXT, DateTrigger INTEGER, DateTriggerLocal INTEGER, triggerTimeZone TEXT, Description TEXT, Attachment TEXT, Summary TEXT, Address TEXT, CustomProperties TEXT, isEnabled INTEGER)"

◆ CREATE_ATTACHMENTS

#define CREATE_ATTACHMENTS   "CREATE TABLE IF NOT EXISTS Attachments(ComponentId INTEGER, Data BLOB, Uri TEXT, MimeType TEXT, ShowInLine INTEGER, Label TEXT, Local INTEGER)"

◆ CREATE_ATTENDEE

#define CREATE_ATTENDEE   "CREATE TABLE IF NOT EXISTS Attendee(ComponentId INTEGER, Email TEXT, Name TEXT, IsOrganizer INTEGER, Role INTEGER, PartStat INTEGER, Rsvp INTEGER, DelegatedTo TEXT, DelegatedFrom TEXT)"

◆ CREATE_CALENDARPROPERTIES

#define CREATE_CALENDARPROPERTIES    "CREATE TABLE IF NOT EXISTS Calendarproperties(CalendarId REFERENCES Calendars(CalendarId) ON DELETE CASCADE, Name TEXT NOT NULL, Value TEXT, UNIQUE (CalendarId, Name))"

◆ CREATE_CALENDARS

#define CREATE_CALENDARS    "CREATE TABLE IF NOT EXISTS Calendars(CalendarId TEXT PRIMARY KEY, Name TEXT, Description TEXT, Color INTEGER, Flags INTEGER, syncDate INTEGER, pluginName TEXT, account TEXT, attachmentSize INTEGER, modifiedDate INTEGER, sharedWith TEXT, syncProfile TEXT, createdDate INTEGER, extra1 STRING, extra2 STRING)"

◆ CREATE_COMPONENTS

#define CREATE_COMPONENTS    "CREATE TABLE IF NOT EXISTS Components(ComponentId INTEGER PRIMARY KEY AUTOINCREMENT, Notebook TEXT, Type TEXT, Summary TEXT, Category TEXT, DateStart INTEGER, DateStartLocal INTEGER, StartTimeZone TEXT, HasDueDate INTEGER, DateEndDue INTEGER, DateEndDueLocal INTEGER, EndDueTimeZone TEXT, Duration INTEGER, Classification INTEGER, Location TEXT, Description TEXT, Status INTEGER, GeoLatitude REAL, GeoLongitude REAL, Priority INTEGER, Resources TEXT, DateCreated INTEGER, DateStamp INTEGER, DateLastModified INTEGER, Sequence INTEGER, Comments TEXT, Attachments TEXT, Contact TEXT, InvitationStatus INTEGER, RecurId INTEGER, RecurIdLocal INTEGER, RecurIdTimeZone TEXT, RelatedTo TEXT, URL TEXT, UID TEXT, Transparency INTEGER, LocalOnly INTEGER, Percent INTEGER, DateCompleted INTEGER, DateCompletedLocal INTEGER, CompletedTimeZone TEXT, DateDeleted INTEGER, extra1 STRING, extra2 STRING, extra3 INTEGER)"

◆ CREATE_CUSTOMPROPERTIES

#define CREATE_CUSTOMPROPERTIES    "CREATE TABLE IF NOT EXISTS Customproperties(ComponentId INTEGER, Name TEXT, Value TEXT, Parameters TEXT)"

◆ CREATE_RDATES

#define CREATE_RDATES    "CREATE TABLE IF NOT EXISTS Rdates(ComponentId INTEGER, Type INTEGER, Date INTEGER, DateLocal INTEGER, TimeZone TEXT)"

◆ CREATE_RECURSIVE

#define CREATE_RECURSIVE    "CREATE TABLE IF NOT EXISTS Recursive(ComponentId INTEGER, RuleType INTEGER, Frequency INTEGER, Until INTEGER, UntilLocal INTEGER, untilTimeZone TEXT, Count INTEGER, Interval INTEGER, BySecond TEXT, ByMinute TEXT, ByHour TEXT, ByDay TEXT, ByDayPos Text, ByMonthDay TEXT, ByYearDay TEXT, ByWeekNum TEXT, ByMonth TEXT, BySetPos TEXT, WeekStart INTEGER)"

◆ CREATE_TIMEZONES

#define CREATE_TIMEZONES    "CREATE TABLE IF NOT EXISTS Timezones(TzId INTEGER PRIMARY KEY, ICalData TEXT)"

◆ CREATE_VERSION

#define CREATE_VERSION    "CREATE TABLE IF NOT EXISTS Version(Major INTEGER, Minor INTEGER)"

◆ DELETE_ALARM

#define DELETE_ALARM   "delete from Alarm where ComponentId=?"

◆ DELETE_ATTACHMENTS

#define DELETE_ATTACHMENTS   "delete from Attachments where ComponentId=?"

◆ DELETE_ATTENDEE

#define DELETE_ATTENDEE   "delete from Attendee where ComponentId=?"

◆ DELETE_CALENDARPROPERTIES

#define DELETE_CALENDARPROPERTIES   "delete from Calendarproperties where CalendarId=?"

◆ DELETE_CALENDARS

#define DELETE_CALENDARS   "delete from Calendars where CalendarId=?"

◆ DELETE_COMPONENTS

#define DELETE_COMPONENTS   "delete from Components where ComponentId=?"

◆ DELETE_CUSTOMPROPERTIES

#define DELETE_CUSTOMPROPERTIES   "delete from Customproperties where ComponentId=?"

◆ DELETE_INVITATIONS

#define DELETE_INVITATIONS   "delete from Invitations where InvitationId=?"

◆ DELETE_RDATES

#define DELETE_RDATES   "delete from Rdates where ComponentId=?"

◆ DELETE_RECURSIVE

#define DELETE_RECURSIVE   "delete from Recursive where ComponentId=?"

◆ DELETE_TIMEZONES

#define DELETE_TIMEZONES   "delete from Timezones where TzId=1"

◆ FUTURE_DATE_SMART_FIELD

#define FUTURE_DATE_SMART_FIELD   " (case type when 'Todo' then DateEndDue else DateStart end) "

◆ INDEX_ALARM

#define INDEX_ALARM   "CREATE INDEX IF NOT EXISTS IDX_ALARM on Alarm(ComponentId)"

◆ INDEX_ATTACHMENTS

#define INDEX_ATTACHMENTS   "CREATE INDEX IF NOT EXISTS IDX_ATTACHMENTS on Attachments(ComponentId)"

◆ INDEX_ATTENDEE

#define INDEX_ATTENDEE   "CREATE UNIQUE INDEX IF NOT EXISTS IDX_ATTENDEE on Attendee(ComponentId, Email)"

◆ INDEX_CALENDAR

#define INDEX_CALENDAR   "CREATE INDEX IF NOT EXISTS IDX_CALENDAR on Calendars(CalendarId)"

◆ INDEX_CALENDARPROPERTIES

#define INDEX_CALENDARPROPERTIES   "CREATE INDEX IF NOT EXISTS IDX_CALENDARPROPERTIES on Calendarproperties(CalendarId)"

◆ INDEX_COMPONENT

#define INDEX_COMPONENT   "CREATE INDEX IF NOT EXISTS IDX_COMPONENT on Components(ComponentId, Notebook, DateStart, DateEndDue, DateDeleted)"

◆ INDEX_COMPONENT_NOTEBOOK

#define INDEX_COMPONENT_NOTEBOOK   "CREATE INDEX IF NOT EXISTS IDX_COMPONENT_NOTEBOOK on Components(Notebook)"

◆ INDEX_COMPONENT_UID

#define INDEX_COMPONENT_UID   "CREATE UNIQUE INDEX IF NOT EXISTS IDX_COMPONENT_UID on Components(UID, RecurId, DateDeleted)"

◆ INDEX_CUSTOMPROPERTIES

#define INDEX_CUSTOMPROPERTIES   "CREATE INDEX IF NOT EXISTS IDX_CUSTOMPROPERTIES on Customproperties(ComponentId)"

◆ INDEX_INVITATION

#define INDEX_INVITATION   "CREATE INDEX IF NOT EXISTS IDX_INVITATION on Invitations(InvitationId)"

◆ INDEX_RDATES

#define INDEX_RDATES   "CREATE INDEX IF NOT EXISTS IDX_RDATES on Rdates(ComponentId)"

◆ INDEX_RECURSIVE

#define INDEX_RECURSIVE   "CREATE INDEX IF NOT EXISTS IDX_RECURSIVE on Recursive(ComponentId)"

◆ INSERT_ALARM

#define INSERT_ALARM   "insert into Alarm values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"

◆ INSERT_ATTACHMENTS

#define INSERT_ATTACHMENTS   "insert into Attachments values (?, ?, ?, ?, ?, ?, ?)"

◆ INSERT_ATTENDEE

#define INSERT_ATTENDEE   "insert into Attendee values (?, ?, ?, ?, ?, ?, ?, ?, ?)"

◆ INSERT_CALENDARPROPERTIES

#define INSERT_CALENDARPROPERTIES   "insert into Calendarproperties values (?, ?, ?)"

◆ INSERT_CALENDARS

#define INSERT_CALENDARS   "insert into Calendars values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '', '')"

◆ INSERT_COMPONENTS

#define INSERT_COMPONENTS   "insert into Components values (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, '', 0)"

◆ INSERT_CUSTOMPROPERTIES

#define INSERT_CUSTOMPROPERTIES   "insert into Customproperties values (?, ?, ?, ?)"

◆ INSERT_INVITATIONS

#define INSERT_INVITATIONS   "insert into Invitations values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"

◆ INSERT_RDATES

#define INSERT_RDATES   "insert into Rdates values (?, ?, ?, ?, ?)"

◆ INSERT_RECURSIVE

#define INSERT_RECURSIVE   "insert into Recursive values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"

◆ INSERT_TIMEZONES

#define INSERT_TIMEZONES   "insert into Timezones values (1, '')"

◆ INSERT_VERSION

#define INSERT_VERSION   "insert into Version values (?, ?)"

◆ SELECT_ALARM_BY_ID

#define SELECT_ALARM_BY_ID   "select * from Alarm where ComponentId=?"

◆ SELECT_ATTACHMENTS_BY_ID

#define SELECT_ATTACHMENTS_BY_ID   "select * from Attachments where ComponentId=?"

◆ SELECT_ATTENDEE_AND_COUNT

#define SELECT_ATTENDEE_AND_COUNT   "select Email, Name, count(Email) from Attendee where Email<>0 group by Email"

◆ SELECT_ATTENDEE_BY_ID

#define SELECT_ATTENDEE_BY_ID   "select * from Attendee where ComponentId=?"

◆ SELECT_CALENDARPROPERTIES_BY_ID

#define SELECT_CALENDARPROPERTIES_BY_ID   "select * from Calendarproperties where CalendarId=?"

◆ SELECT_CALENDARS_ALL

#define SELECT_CALENDARS_ALL   "select * from Calendars order by Name"

◆ SELECT_COMPONENTS_ALL

#define SELECT_COMPONENTS_ALL   "select * from Components where DateDeleted=0"

◆ SELECT_COMPONENTS_ALL_DELETED

#define SELECT_COMPONENTS_ALL_DELETED   "select * from Components where DateDeleted<>0"

◆ SELECT_COMPONENTS_ALL_DELETED_BY_NOTEBOOK

#define SELECT_COMPONENTS_ALL_DELETED_BY_NOTEBOOK   "select * from Components where Notebook=? and DateDeleted<>0"

◆ SELECT_COMPONENTS_BY_ATTENDEE

#define SELECT_COMPONENTS_BY_ATTENDEE   "select * from components where ComponentId in (select DISTINCT ComponentId from attendee) and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_ATTENDEE_AND_CREATED

#define SELECT_COMPONENTS_BY_ATTENDEE_AND_CREATED   "select * from Components where ComponentId in (select distinct ComponentId from Attendee) and DateCreated<=? and DateDeleted=0 order by DateCreated desc"

◆ SELECT_COMPONENTS_BY_ATTENDEE_EMAIL_AND_CREATED

#define SELECT_COMPONENTS_BY_ATTENDEE_EMAIL_AND_CREATED   "select * from Components where ComponentId in (select distinct ComponentId from Attendee where email=?) and DateCreated<=? and DateDeleted=0 order by DateCreated desc"

◆ SELECT_COMPONENTS_BY_COMPLETED_TODOS_AND_CREATED

#define SELECT_COMPONENTS_BY_COMPLETED_TODOS_AND_CREATED   "select * from Components where Type='Todo' and DateCompleted<>0 and DateEndDue=0 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"

◆ SELECT_COMPONENTS_BY_COMPLETED_TODOS_AND_DATE

#define SELECT_COMPONENTS_BY_COMPLETED_TODOS_AND_DATE   "select * from Components where Type='Todo' and DateCompleted<>0 and DateEndDue<>0 and DateEndDue<=? and DateDeleted=0 order by DateEndDue desc, DateCreated desc"

◆ SELECT_COMPONENTS_BY_CREATED

#define SELECT_COMPONENTS_BY_CREATED   "select * from Components where DateCreated>=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_CREATED_AND_NOTEBOOK

#define SELECT_COMPONENTS_BY_CREATED_AND_NOTEBOOK   "select * from Components where DateCreated>=? and Notebook=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_CREATED_SMART

#define SELECT_COMPONENTS_BY_CREATED_SMART   "select * from Components where DateEndDue=0 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"

◆ SELECT_COMPONENTS_BY_DATE_BOTH

#define SELECT_COMPONENTS_BY_DATE_BOTH   "select * from Components where DateStart<=? and (DateEndDue>=? or DateEndDue=0) and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_DATE_END

#define SELECT_COMPONENTS_BY_DATE_END   "select * from Components where DateStart<=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_DATE_SMART

#define SELECT_COMPONENTS_BY_DATE_SMART   "select * from Components where DateEndDue<>0 and DateEndDue<=? and DateDeleted=0 order by DateEndDue desc, DateCreated desc"

◆ SELECT_COMPONENTS_BY_DATE_START

#define SELECT_COMPONENTS_BY_DATE_START   "select * from Components where DateEndDue>=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_DELETED

#define SELECT_COMPONENTS_BY_DELETED   "select * from Components where DateDeleted>=? and DateCreated<?"

◆ SELECT_COMPONENTS_BY_DELETED_AND_NOTEBOOK

#define SELECT_COMPONENTS_BY_DELETED_AND_NOTEBOOK   "select * from Components where DateDeleted>=? and DateCreated<? and Notebook=?"

◆ SELECT_COMPONENTS_BY_DUPLICATE

#define SELECT_COMPONENTS_BY_DUPLICATE   "select * from Components where DateStart=? and Summary=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_DUPLICATE_AND_NOTEBOOK

#define SELECT_COMPONENTS_BY_DUPLICATE_AND_NOTEBOOK   "select * from Components where DateStart=? and Summary=? and Notebook=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_FUTURE_DATE_SMART

#define SELECT_COMPONENTS_BY_FUTURE_DATE_SMART
Value:
"select * from Components where " \
FUTURE_DATE_SMART_FIELD ">=? and DateDeleted=0 order by " \
FUTURE_DATE_SMART_FIELD " asc, DateCreated asc"

◆ SELECT_COMPONENTS_BY_GEO

#define SELECT_COMPONENTS_BY_GEO   "select * from Components where GeoLatitude!=255.0 and GeoLongitude!=255.0 and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_GEO_AND_CREATED

#define SELECT_COMPONENTS_BY_GEO_AND_CREATED   "select * from Components where GeoLatitude!=255.0 and GeoLongitude!=255.0 and DateEndDue=0 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"

◆ SELECT_COMPONENTS_BY_GEO_AND_DATE

#define SELECT_COMPONENTS_BY_GEO_AND_DATE   "select * from Components where GeoLatitude!=255.0 and GeoLongitude!=255.0 and DateEndDue<>0 and DateEndDue<=? and DateDeleted=0 order by DateEndDue desc, DateCreated desc"

◆ SELECT_COMPONENTS_BY_GEO_AREA

#define SELECT_COMPONENTS_BY_GEO_AREA   "select * from Components where GeoLatitude>=? and GeoLongitude>=? and GeoLatitude<=? and GeoLongitude<=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_INVITATION_AND_CREATED

#define SELECT_COMPONENTS_BY_INVITATION_AND_CREATED   "select * from Components where InvitationStatus>1 and DateCreated<=? and DateDeleted=0 order by DateCreated desc"

◆ SELECT_COMPONENTS_BY_INVITATION_UNREAD

#define SELECT_COMPONENTS_BY_INVITATION_UNREAD   "select * from Components where InvitationStatus=1 and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_JOURNAL

#define SELECT_COMPONENTS_BY_JOURNAL   "select * from Components where Type='Journal' and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_JOURNAL_DATE

#define SELECT_COMPONENTS_BY_JOURNAL_DATE   "select * from Components where Type='Journal' and DateDeleted=0 and datestart<=? order by DateStart desc, DateCreated desc"

◆ SELECT_COMPONENTS_BY_LAST_MODIFIED

#define SELECT_COMPONENTS_BY_LAST_MODIFIED   "select * from Components where DateLastModified>=? and DateCreated<? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_LAST_MODIFIED_AND_NOTEBOOK

#define SELECT_COMPONENTS_BY_LAST_MODIFIED_AND_NOTEBOOK   "select * from Components where DateLastModified>=? and DateCreated<? and Notebook=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_NOTEBOOK

#define SELECT_COMPONENTS_BY_NOTEBOOK   "select * from Components where Notebook=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_NOTEBOOKUID

#define SELECT_COMPONENTS_BY_NOTEBOOKUID   "select * from Components where Notebook=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_PLAIN

#define SELECT_COMPONENTS_BY_PLAIN   "select * from Components where DateStart=0 and DateEndDue=0 and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_RECURSIVE

#define SELECT_COMPONENTS_BY_RECURSIVE   "select * from components where ((ComponentId in (select DISTINCT ComponentId from recursive)) or (RecurId!=0)) and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_UID

#define SELECT_COMPONENTS_BY_UID   "select * from Components where UID=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_UID_AND_RECURID

#define SELECT_COMPONENTS_BY_UID_AND_RECURID   "select * from Components where UID=? and RecurId=? and DateDeleted=0"

◆ SELECT_COMPONENTS_BY_UID_RECID_AND_DELETED

#define SELECT_COMPONENTS_BY_UID_RECID_AND_DELETED   "select ComponentId, DateDeleted from Components where UID=? and RecurId=? and DateDeleted<>0"

◆ SELECT_COMPONENTS_BY_UNCOMPLETED_TODOS

#define SELECT_COMPONENTS_BY_UNCOMPLETED_TODOS   "select * from Components where Type='Todo' and DateCompleted=0 and DateDeleted=0"

◆ SELECT_CUSTOMPROPERTIES_BY_ID

#define SELECT_CUSTOMPROPERTIES_BY_ID   "select * from Customproperties where ComponentId=?"

◆ SELECT_EVENT_COUNT

#define SELECT_EVENT_COUNT   "select count(*) from Components where Type='Event' and DateDeleted=0"

◆ SELECT_INVITATIONS_ALL

#define SELECT_INVITATIONS_ALL   "select * from Invitations"

◆ SELECT_JOURNAL_COUNT

#define SELECT_JOURNAL_COUNT   "select count(*) from Components where Type='Journal' and DateDeleted=0"

◆ SELECT_RDATES_BY_ID

#define SELECT_RDATES_BY_ID   "select * from Rdates where ComponentId=?"

◆ SELECT_RECURSIVE_BY_ID

#define SELECT_RECURSIVE_BY_ID   "select * from Recursive where ComponentId=?"

◆ SELECT_ROWID_FROM_COMPONENTS_BY_UID_AND_RECURID

#define SELECT_ROWID_FROM_COMPONENTS_BY_UID_AND_RECURID   "select ComponentId from Components where UID=? and RecurId=? and DateDeleted=0"

◆ SELECT_TIMEZONES

#define SELECT_TIMEZONES   "select * from Timezones where TzId=1"

◆ SELECT_TODO_COUNT

#define SELECT_TODO_COUNT   "select count(*) from Components where Type='Todo' and DateDeleted=0"

◆ SELECT_VERSION

#define SELECT_VERSION   "select * from Version"

◆ sqlite3_bind_blob

#define sqlite3_bind_blob (   stmt,
  index,
  value,
  size,
  desc 
)
Value:
{ \
rv = sqlite3_bind_blob( (stmt), (index), (value), (size), (desc) ); \
if ( rv ) { \
qCWarning(lcMkcal) << "sqlite3_bind_blob error:" << rv << "on index and value:" << index << value; \
goto error; \
} \
index++; \
}
#define sqlite3_bind_blob(stmt, index, value, size, desc)
Definition: sqlitestorage.h:479

◆ sqlite3_bind_double

#define sqlite3_bind_double (   stmt,
  index,
  value 
)
Value:
{ \
rv = sqlite3_bind_double( (stmt), (index), (value) ); \
if ( rv ) { \
qCWarning(lcMkcal) << "sqlite3_bind_int error:" << rv << "on index and value:" << index << value; \
goto error; \
} \
index++; \
}
#define sqlite3_bind_double(stmt, index, value)
Definition: sqlitestorage.h:509

◆ sqlite3_bind_int

#define sqlite3_bind_int (   stmt,
  index,
  value 
)
Value:
{ \
rv = sqlite3_bind_int( (stmt), (index), (value) ); \
if ( rv ) { \
qCWarning(lcMkcal) << "sqlite3_bind_int error:" << rv << "on index and value:" << index << value; \
goto error; \
} \
index++; \
}
#define sqlite3_bind_int(stmt, index, value)
Definition: sqlitestorage.h:489

◆ sqlite3_bind_int64

#define sqlite3_bind_int64 (   stmt,
  index,
  value 
)
Value:
{ \
rv = sqlite3_bind_int64( (stmt), (index), (value) ); \
if ( rv ) { \
qCWarning(lcMkcal) << "sqlite3_bind_int64 error:" << rv << "on index and value:" << index << value; \
goto error; \
} \
index++; \
}
#define sqlite3_bind_int64(stmt, index, value)
Definition: sqlitestorage.h:499

◆ sqlite3_bind_text

#define sqlite3_bind_text (   stmt,
  index,
  value,
  size,
  desc 
)
Value:
{ \
rv = sqlite3_bind_text( (stmt), (index), (value), (size), (desc) ); \
if ( rv ) { \
qCWarning(lcMkcal) << "sqlite3_bind_text error:" << rv << "on index and value:" << index << value; \
goto error; \
} \
index++; \
}
#define sqlite3_bind_text(stmt, index, value, size, desc)
Definition: sqlitestorage.h:469

◆ sqlite3_exec

#define sqlite3_exec (   db)
Value:
{ \
/* kDebug() << "SQL query:" << query; */ \
rv = sqlite3_exec( (db), query, NULL, 0, &errmsg ); \
if ( rv ) { \
if ( rv != SQLITE_CONSTRAINT ) { \
qCWarning(lcMkcal) << "sqlite3_exec error code:" << rv; \
} \
if ( errmsg ) { \
if ( rv != SQLITE_CONSTRAINT ) { \
qCWarning(lcMkcal) << errmsg; \
} \
sqlite3_free( errmsg ); \
errmsg = NULL; \
} \
if ( rv != SQLITE_CONSTRAINT ) { \
goto error; \
} \
} \
}
#define sqlite3_exec(db)
Definition: sqlitestorage.h:437

◆ sqlite3_prepare_v2

#define sqlite3_prepare_v2 (   db,
  query,
  qsize,
  stmt,
  tail 
)
Value:
{ \
/* kDebug() << "SQL query:" << query; */ \
rv = sqlite3_prepare_v2( (db), (query), (qsize), (stmt), (tail) ); \
if ( rv ) { \
qCWarning(lcMkcal) << "sqlite3_prepare error code:" << rv; \
qCWarning(lcMkcal) << sqlite3_errmsg( (db) ); \
goto error; \
} \
}
#define sqlite3_prepare_v2(db, query, qsize, stmt, tail)
Definition: sqlitestorage.h:458

◆ sqlite3_step

#define sqlite3_step (   stmt)
Value:
{ \
rv = sqlite3_step( (stmt) ); \
if ( rv && rv != SQLITE_DONE && rv != SQLITE_ROW ) { \
if ( rv != SQLITE_CONSTRAINT ) { \
qCWarning(lcMkcal) << "sqlite3_step error:" << rv; \
} \
goto error; \
} \
}
#define sqlite3_step(stmt)
Definition: sqlitestorage.h:519

◆ UPDATE_CALENDARS

#define UPDATE_CALENDARS   "update Calendars set Name=?, Description=?, Color=?, Flags=?, syncDate=?, pluginName=?, account=?, attachmentSize=?, modifiedDate=?, sharedWith=?, syncProfile=?, createdDate=? where CalendarId=?"

◆ UPDATE_COMPONENTS

#define UPDATE_COMPONENTS   "update Components set Notebook=?, Type=?, Summary=?, Category=?, DateStart=?, DateStartLocal=?, StartTimeZone=?, HasDueDate=?, DateEndDue=?, DateEndDueLocal=?, EndDueTimeZone=?, Duration=?, Classification=?, Location=?, Description=?, Status=?, GeoLatitude=?, GeoLongitude=?, Priority=?, Resources=?, DateCreated=?, DateStamp=?, DateLastModified=?, Sequence=?, Comments=?, Attachments=?, Contact=?, InvitationStatus=?, RecurId=?, RecurIdLocal=?, RecurIdTimeZone=?, RelatedTo=?, URL=?, UID=?, Transparency=?, LocalOnly=?, Percent=?, DateCompleted=?, DateCompletedLocal=?, CompletedTimeZone=?, extra1=? where ComponentId=?"

◆ UPDATE_COMPONENTS_AS_DELETED

#define UPDATE_COMPONENTS_AS_DELETED   "update Components set DateDeleted=? where ComponentId=?"

◆ UPDATE_TIMEZONES

#define UPDATE_TIMEZONES   "update Timezones set ICalData=? where TzId=1"

Generated on Wed Jun 9 2021 13:59:25 for libextendedkcal by doxygen 1.9.1