Den 20. juli 2011 17:35, skrev Patrick Ohly:
On Mi, 2011-07-20 at 16:25 +0100, Roger KeIrad wrote:
> Hi,
>
> To develop calendar sqlite backend that synchronize vcalendar what
> should i use ?
You need to extend the src/backends/sqlite code to support some kind of
calendar schema. There is not one "official" mapping of calendar data
into sqlite - you'll have to adapt this to your own needs.
Do you already have an existing sqlite schema for calendar?
I've just found one possible case for this - syncing with GPE Calendar.
(I've noted that some people claim the GPE Calendar is better than the
N900's builtin calendar. Personally, I think the N900 calendar is good
enough for me as long as I can sync it with a system like Google
Calendar, and I think the GPE Calendar interface is more annoying to use
than the native N900 apps, but apparently there are people who find the
GPE Calendar more capable, so I became a bit curious about what it would
take to sync with it. While not important to me, I figured I may as well
try to compile the SyncEvolution packages with support for it, if it
turned out to be easy enough.)
Installing the desktop version of the GPE Calendar on my laptop allowed
me to view its schema easily.
If someone ever writes a SQLite calendar backend for SyncEvolution, then
making it compatible with this schema might be useful. (Of course, for
this use case, making a GPE backend using the GPE libraries might be
another option, but who knows which backend is more likely to happen...)
sqlite> .tables
alarms_fired_through calendar_dbinfo events
alarms_unacknowledged calendars events_deleted
calendar default_calendar
sqlite> .schema calendars
create table calendars (title TEXT, description TEXT, url TEXT,
username TEXT, password TEXT, parent INTEGER, hidden INTEGER,
has_color INTEGER, red INTEGER, green INTEGER, blue INTEGER, mode
INTEGER, sync_interval INTEGER, last_pull INTEGER, last_push INTEGER,
last_modified);
sqlite> .schema calendar
create table calendar (uid INTEGER not NULL, tag STRING, value STRING);
sqlite> .schema calendar_dbinfo
create table calendar_dbinfo (version integer NOT NULL);
sqlite> .schema events
create table events (uid INTEGER PRIMARY KEY, start DATE, duration
INTEGER, recur INTEGER, rend DATE, alarm INTEGER, calendar INTEGER,
eventid STRING, rcount INTEGER, rincrement INTEGER, modified DATE,
byday STRING, rexceptions STRING);
create index events_enumerate_index on events (start, duration, rend,
alarm);
sqlite> .schema events_deleted
create table events_deleted (uid INTEGER PRIMARY KEY, eventid STRING NOT
NULL, calendar INTEGER);
sqlite> .schema alarms_fired_through
create table alarms_fired_through (time INTEGER);
sqlite> .schema alarms_unacknowledged
create table alarms_unacknowledged (uid INTEGER, start INTEGER NOT NULL);
sqlite> .schema default_calendar
create table default_calendar (default_calendar INTEGER);