Calendar database

m (CalendarId)
m (removed section edit links with __NOEDITSECTION__ magic word to prettify the page a bit)
 
(7 intermediate revisions not shown)
Line 1: Line 1:
The [[Open development/Maemo roadmap/Fremantle|Maemo 5]] calendar database can be found in <code>/home/user/.calendar/calendardb</code>. The goal of this article is to provide enough information on the calendar database in order to implement mass modifying/adding/deleting events verifying some criterias (string match in title, locations, comments for example). It could be easy then to write a small shell script using zenity and sqlite3 to perform this tasks.
The [[Open development/Maemo roadmap/Fremantle|Maemo 5]] calendar database can be found in <code>/home/user/.calendar/calendardb</code>. The goal of this article is to provide enough information on the calendar database in order to implement mass modifying/adding/deleting events verifying some criterias (string match in title, locations, comments for example). It could be easy then to write a small shell script using zenity and sqlite3 to perform this tasks.
-
If you want to help editing this article and writing useful informations on fields or new scripts, feel free to copy your own database on your computer and analyze it with some tools like "SQLite Database Browser" (Linux/Debian).
+
If you want to help editing this article and writing useful informations on fields or new scripts, feel free to copy your own database on your computer and analyze it with some tools like "SQLite Database Browser" (Linux/Debian). The datatypes are those listed in the [http://www.sqlite.org/datatype3.html SQLite documentation].
 +
__NOEDITSECTION__<!-- removes section edit links as they look quite ugly on this page. -ashley on 8 June 2013 -->
 +
== [[#toc|Structure]] ==
 +
=== [[#toc|Tables & fields]] ===
-
== Scripts ==
+
==== [[#toc|ALARM]] ====
-
== Structure ==
 
-
=== Tables & fields ===
 
-
 
-
----
 
-
==== ALARM ====
 
-
----
 
===== Id =====
===== Id =====
===== Trigger =====
===== Trigger =====
Line 19: Line 16:
===== Attach =====
===== Attach =====
-
----
+
==== [[#toc|Birthdays]] ====
-
==== Birthdays ====
+
-
----
+
-
===== Id =====
+
-
===== DayMonth =====
+
-
===== Year =====
+
-
----
+
{| class="wikitable"
-
==== Calendars ====
+
|+ Birthdays table
-
----
+
-
===== CalendarId =====
+
-
===== Name =====
+
-
===== Colour =====
+
-
:{| class="wikitable"
+
|-
|-
-
| 0 || dark blue
+
! Field !! Type !! Description
|-
|-
-
| 1 || green
+
| Id || integer || primary key
|-
|-
-
| 2 || dark pink
+
| DayMonth || integer || Day and month as a combined integer. Calculated as: month*100+day (day with a leading zero). 1102 means November 2
|-
|-
-
| 3 || orange
+
| Year || integer || Year as a number.
-
|-
+
-
| 4 || purple
+
-
|-
+
-
| 5 || yellow
+
-
|-
+
-
| 6 || white
+
-
|-
+
-
| 7 || light blue
+
-
|-
+
-
| 8 || light pink
+
-
|-
+
-
| 9 || yellow-green
+
|}
|}
-
===== IsVisible =====
+
==== [[#toc|Calendars]] ====
-
:{| class="wikitable"
+
-
|-
+
-
| 0 || not visible
+
-
|-
+
-
| 1 || visible
+
-
|-
+
-
|}
+
-
===== IsReadonly =====
+
{| class="wikitable"
-
:{| class="wikitable"
+
|+ Calendars table
|-
|-
-
| 0 || writeable
+
! Field !! Type !! Description
|-
|-
-
| 1 || not writeable
+
| CalendarId || integer || primary key
|-
|-
-
|}
+
| Name || text || name of the calendar
-
 
+
-
===== CalendarType =====
+
-
:{| class="wikitable"
+
|-
|-
-
| 0 || local
+
| Colour || integer || 0 = dark blue, 1 = green, 2 = dark pink, 3 = orange, 4 = purple, 5 = yellow, 6 = white, 7 = light blue, 8 = light pink, 9 = yellow-green
|-
|-
-
| 1 || intelligent
+
| isVisible || integer || 0 = not visible, 1 = visible
|-
|-
-
| 2 ||  
+
| isReadonly || integer || 0 = writeable, 1 = not writeable
|-
|-
-
| 3 || private
+
| CalendarType || integer || 0 = local, 1 = intelligent, 2 = ?, 3 = private, 4 = synchronized
-
|-
+
-
| 4 || synchronized
+
-
|-
+
-
|}
+
-
 
+
-
===== CalendarTune =====
+
-
:{| class="wikitable"
+
|-
|-
-
| <txt> || path to the calendar alarm sound
+
| CalendarTune || text || Path to the calendar alarm sound. Default path: <code>/usr/share/sounds/ui-calendar_alarm_default.aac</code>
|-
|-
-
| <code>/usr/share/sounds/ui-calendar_alarm_default.aac</code> || default alarm
+
| CalendarVersion || ||
|-
|-
 +
| CalendarProfile || ||
|}
|}
-
===== CalendarVersion =====
+
==== [[#toc|ComponentDetails]] ====
-
===== CalendarProfile =====
+
-
----
 
-
==== ComponentDetails ====
 
-
----
 
===== Id =====
===== Id =====
===== ComponentType =====
===== ComponentType =====
Line 122: Line 77:
===== Completed =====
===== Completed =====
-
----
+
==== [[#toc|Components]] ====
-
==== Components ====
+
-
----
+
-
===== Id =====
+
-
:{| class="wikitable"
+
-
|-
+
-
| <int> || primary key
+
-
|-
+
-
|}
+
-
===== CalendarId =====
+
-
:{| class="wikitable"
+
-
|-
+
-
| <int> || [[CalendarId|calendar identifier]] associated to the component
+
-
|-
+
-
|}
+
-
===== ComponentType =====
+
{| class="wikitable"
-
:{| class="wikitable"
+
|+ Components table
|-
|-
-
| 1 || event
+
! Field !! Type !! Description
|-
|-
-
| 2 || task
+
| Id || integer || primary key
|-
|-
-
| 3 || note
+
| CalendarId || integer || association with the corresponding [[#Calendar|calender]]
|-
|-
-
| 4 || birthday
+
| ComponentType || integer || 1 = event, 2 = task, 3 = note, 4 = birthday
|-
|-
-
|}
+
| Flags || integer || 3 = has recursive entry, 4 = has alarm, 5 = has both
-
 
+
-
===== Flags =====
+
-
===== DateStart =====
+
-
:{| class="wikitable"
+
|-
|-
-
| <int> || UTC start date in Unix Time Format (number of seconds since 01/01/1970)
+
| DateStart || integer || UTC start date in Unix Time Format (number of seconds since 01/01/1970)
|-
|-
-
|}
+
| DateEnd || integer || -1 = undefined, otherwise UTC end date in Unix Time Format (number of seconds since 01/01/1970)
-
 
+
-
===== DateEnd =====
+
-
:{| class="wikitable"
+
|-
|-
-
| -1 || undefined
+
| Summary || text || title [event, task, note, birthday]
|-
|-
-
| <int> || UTC end date in Unix Time Format (number of seconds since 01/01/1970)
+
| Location || text || location [event]
|-
|-
-
|}
+
| Description || text || comments [event, task, note]
-
 
+
-
===== Summary =====
+
-
:{| class="wikitable"
+
|-
|-
-
| <txt> || title [event, task, note, birthday]
+
| Status || integer || -1 = undefined [event, note]. 0 = incomplete [task], 1 = complete [task], yyyy = year [birthday]
|-
|-
-
|}
+
| Uid || ||
-
 
+
-
===== Location =====
+
-
:{| class="wikitable"
+
|-
|-
-
| <txt> || location [event]
+
| Until || integer || -1 = none [event, tastk, note], 2145913199 = end of calendar / limit of the Unix Time Format, other integer = end date of a recurrence [event, birthday]
|-
|-
-
|}
+
| AllDay || integer || 0 = in limited time [event, task, note], 1 = all day [event, birthday]
-
 
+
-
===== Description =====
+
-
:{| class="wikitable"
+
|-
|-
-
| <txt> || comments [event, task, note]
+
| CreatedTime || integer || date of creation
|-
|-
-
|}
+
| ModifiedTime || integer || last date of modification
-
 
+
-
===== Status =====
+
-
:{| class="wikitable"
+
|-
|-
-
| -1 || undefined [event, note]
+
| Tzid || text || time zone identifier, for example "<code>Europe/Paris</code>"
-
|-
+
-
| 0 || uncomplete [task]
+
-
|-
+
-
| 1 || complete [task]
+
-
|-
+
-
| <yyyy> || year [birthday]
+
|-
|-
 +
| TzOffset || text || time zone offset in seconds compared to UTC, for example "<code>7200</code>" (2 hours)
|}
|}
-
===== Uid =====
+
==== [[#toc|IDMAP]] ====
-
===== Until =====
+
-
:{| class="wikitable"
+
-
|-
+
-
| -1 || none [event, task, note]
+
-
|-
+
-
| <int> || end date of a recurrence [event, birthday]
+
-
|-
+
-
| 2145913199 || end of calendar / limit of the Unix Time Format
+
-
|}
+
-
===== AllDay =====
 
-
:{| class="wikitable"
 
-
|-
 
-
| 0 || in limited time [event, task, note]
 
-
|-
 
-
| 1 || all day [event, birthday]
 
-
|-
 
-
|}
 
-
 
-
===== CreatedTime =====
 
-
:{| class="wikitable"
 
-
|-
 
-
| <int> || date of creation
 
-
|-
 
-
|}
 
-
 
-
===== ModifiedTime =====
 
-
:{| class="wikitable"
 
-
|-
 
-
| <int> || last date of modification
 
-
|-
 
-
|}
 
-
 
-
===== Tzid =====
 
-
:{| class="wikitable"
 
-
|-
 
-
| <txt> || time zone identifier
 
-
|-
 
-
| :Europe/Paris || France time zone
 
-
|-
 
-
|}
 
-
 
-
===== TzOffset =====
 
-
:{| class="wikitable"
 
-
|-
 
-
| <txt> || time zone offset in seconds compared to UTC
 
-
|-
 
-
| 7200 || France time zone offset (2 hours)
 
-
|-
 
-
|}
 
-
 
-
----
 
-
 
-
==== IDMAP ====
 
-
----
 
===== LocalId =====
===== LocalId =====
===== ExternalId =====
===== ExternalId =====
-
----
+
==== [[#toc|Instances]] ====
-
==== Instances ====
+
 
-
----
+
===== Id =====
===== Id =====
===== DateStart =====
===== DateStart =====
===== DateEnd =====
===== DateEnd =====
-
----
+
==== [[#toc|Parameters]] ====
-
==== Parameters ====
+
 
-
----
+
===== ComponentId =====
===== ComponentId =====
===== PropertyType =====
===== PropertyType =====
Line 277: Line 138:
===== ParamValue =====
===== ParamValue =====
-
----
+
==== [[#toc|RECURSIVE]] ====
-
==== RECURSIVE ====
+
 
-
----
+
===== Id =====
===== Id =====
===== Rrule =====
===== Rrule =====
Line 288: Line 148:
===== Rtype =====
===== Rtype =====
-
----
+
==== [[#toc|TIMEZONE]] ====
-
==== TIMEZONE ====
+
 
-
----
+
===== Location =====
===== Location =====
===== Tzid =====
===== Tzid =====
Line 302: Line 161:
===== DSTFlag =====
===== DSTFlag =====
-
----
+
 
-
==== Trash ====
+
==== [[#toc|Trash]] ====
-
----
+
 
===== ComponentId =====
===== ComponentId =====
===== CalendarId =====
===== CalendarId =====
Line 311: Line 170:
===== CreatedTime =====
===== CreatedTime =====
-
----
+
==== [[#toc|XProperties]] ====
-
==== XProperties ====
+
 
-
----
+
===== ComponentId =====
===== ComponentId =====
===== XPropertyName =====
===== XPropertyName =====
===== XPropertyValue =====
===== XPropertyValue =====
-
----
+
==== [[#toc|sqlite_sequence]] ====
-
==== sqlite_sequence ====
+
 
-
----
+
===== name =====
===== name =====
===== seq =====
===== seq =====
-
 
+
=== [[#toc|Indices]] ===
-
=== Indices ===
+
==== IDX_ALARM ====
==== IDX_ALARM ====
==== IDX_BIRTHDAYS_DATE ====
==== IDX_BIRTHDAYS_DATE ====

Latest revision as of 12:14, 8 June 2013

The Maemo 5 calendar database can be found in /home/user/.calendar/calendardb. The goal of this article is to provide enough information on the calendar database in order to implement mass modifying/adding/deleting events verifying some criterias (string match in title, locations, comments for example). It could be easy then to write a small shell script using zenity and sqlite3 to perform this tasks.

If you want to help editing this article and writing useful informations on fields or new scripts, feel free to copy your own database on your computer and analyze it with some tools like "SQLite Database Browser" (Linux/Debian). The datatypes are those listed in the SQLite documentation.

Contents

Structure

Tables & fields

ALARM

Id
Trigger
Repeat
Duration
Action
CookieId
Attach

Birthdays

Birthdays table
Field Type Description
Id integer primary key
DayMonth integer Day and month as a combined integer. Calculated as: month*100+day (day with a leading zero). 1102 means November 2
Year integer Year as a number.

Calendars

Calendars table
Field Type Description
CalendarId integer primary key
Name text name of the calendar
Colour integer 0 = dark blue, 1 = green, 2 = dark pink, 3 = orange, 4 = purple, 5 = yellow, 6 = white, 7 = light blue, 8 = light pink, 9 = yellow-green
isVisible integer 0 = not visible, 1 = visible
isReadonly integer 0 = writeable, 1 = not writeable
CalendarType integer 0 = local, 1 = intelligent, 2 = ?, 3 = private, 4 = synchronized
CalendarTune text Path to the calendar alarm sound. Default path: /usr/share/sounds/ui-calendar_alarm_default.aac
CalendarVersion
CalendarProfile

ComponentDetails

Id
ComponentType
Class
Geo
Priority
DateStamp
Sequence
Transparency
Uid
Url
Attach
Category
Comment
Contact
Related
Resources
Percent
Completed

Components

Components table
Field Type Description
Id integer primary key
CalendarId integer association with the corresponding calender
ComponentType integer 1 = event, 2 = task, 3 = note, 4 = birthday
Flags integer 3 = has recursive entry, 4 = has alarm, 5 = has both
DateStart integer UTC start date in Unix Time Format (number of seconds since 01/01/1970)
DateEnd integer -1 = undefined, otherwise UTC end date in Unix Time Format (number of seconds since 01/01/1970)
Summary text title [event, task, note, birthday]
Location text location [event]
Description text comments [event, task, note]
Status integer -1 = undefined [event, note]. 0 = incomplete [task], 1 = complete [task], yyyy = year [birthday]
Uid
Until integer -1 = none [event, tastk, note], 2145913199 = end of calendar / limit of the Unix Time Format, other integer = end date of a recurrence [event, birthday]
AllDay integer 0 = in limited time [event, task, note], 1 = all day [event, birthday]
CreatedTime integer date of creation
ModifiedTime integer last date of modification
Tzid text time zone identifier, for example "Europe/Paris"
TzOffset text time zone offset in seconds compared to UTC, for example "7200" (2 hours)

IDMAP

LocalId
ExternalId

Instances

Id
DateStart
DateEnd

Parameters

ComponentId
PropertyType
PropertyValue
ParamName
ParamValue

RECURSIVE

Id
Rrule
Rdates
Exdates
Exrule
RecurrenceId
Rtype

TIMEZONE

Location
Tzid
DtStartStd
DtStartDst
TzOffsetStd
TzOffsetDst
RRuleStd
RRuleDst
TzName
DSTFlag

Trash

ComponentId
CalendarId
ComponentType
DeletedTime
CreatedTime

XProperties

ComponentId
XPropertyName
XPropertyValue

sqlite_sequence

name
seq

Indices

IDX_ALARM

IDX_BIRTHDAYS_DATE

IDX_BIRTHDAYS_IDS

IDX_CALENDAR

IDX_COMPONENT

IDX_DETAILS

IDX_INST

IDX_RECURSIVE

IDX_TIMEZONE

IDX_TRASH